why inter-changing pci slot works? - Linux

This is a discussion on why inter-changing pci slot works? - Linux ; Hello group! Sometime it happens that two adjacent PCI cards don't work. But as you interchange their slots. The pair starts working. Why is it so? Is it related to the priority of the IRQs? Thanks regards --Himanshu...

+ Reply to Thread
Results 1 to 13 of 13

Thread: why inter-changing pci slot works?

  1. why inter-changing pci slot works?

    Hello group!

    Sometime it happens that two adjacent PCI cards don't work. But as you
    interchange their slots. The pair starts working. Why is it so?

    Is it related to the priority of the IRQs?

    Thanks

    regards
    --Himanshu

  2. Re: why inter-changing pci slot works?


    Himanshu Chauhan wrote:

    > Hello group!
    >
    > Sometime it happens that two adjacent PCI cards don't work. But as you
    > interchange their slots. The pair starts working. Why is it so?
    >
    > Is it related to the priority of the IRQs?
    >
    > Thanks


    There could be a lot of reasons. I think the three most common are:

    1) One of the slots shares an IRQ with an on-board device, and the
    drivers of the on-board device and the card you put in that slot can't
    cooperate.

    2) The two slots share an IRQ with each other, and the two devices
    can't cooperate.

    3) Some of the slots are different and some of the device won't work
    properly in some of the slots.

    It would help if you were more specific. For example, when you say
    "interchange their slots" do you mean swap the two devices? Or move one
    of the devices to an empty slot? What devices?

    DS


  3. Re: why inter-changing pci slot works?

    David Schwartz wrote:
    > Himanshu Chauhan wrote:
    >
    >> Hello group!
    >>
    >> Sometime it happens that two adjacent PCI cards don't work. But as you
    >> interchange their slots. The pair starts working. Why is it so?
    >>
    >> Is it related to the priority of the IRQs?
    >>
    >> Thanks

    >
    >
    >
    > It would help if you were more specific. For example, when you say
    > "interchange their slots" do you mean swap the two devices? Or move one
    > of the devices to an empty slot? What devices?
    >
    > DS
    >


    Okay, to be more specific sometimes back I had an internal modem card on
    slot 1 and soundcard on slot 2. They didn't work with that arrangement.
    I swapped the cards then and both of them were working. Recently, I put
    the ethernet card in the second slot. It didn't work. I just changed its
    position to the 3rd slot and it worked! This time it is the only card so
    I think IRQ consideration is out of question. Right?

    --Himanshu

  4. Re: why inter-changing pci slot works?

    On Wed, 27 Dec 2006 22:24:08 +0530, Himanshu Chauhan wrote:


    >Hello group!


    >Sometime it happens that two adjacent PCI cards don't work. But as you
    >interchange their slots. The pair starts working. Why is it so?


    >Is it related to the priority of the IRQs?


    It depends on how the motherboard has assigned interrupts.
    The cards typically share interrupts with onboard devices.

  5. Re: why inter-changing pci slot works?

    In article ,
    Himanshu Chauhan wrote:
    >Okay, to be more specific sometimes back I had an internal modem card on
    >slot 1 and soundcard on slot 2. They didn't work with that arrangement.
    >I swapped the cards then and both of them were working. Recently, I put
    >the ethernet card in the second slot. It didn't work. I just changed its
    >position to the 3rd slot and it worked! This time it is the only card so
    > I think IRQ consideration is out of question. Right?


    Thats wrong. As stated in the previous article you might have onboard-devices
    which shares the IRQ with the pci-slots. For example on my ASUS-board
    pci-slot 2 shares the IRQ with onboard SATA/USB2/Audio. The manual of
    your board should include the detailed information about the IRQ-sharing.

    regards

    winfried

    --
    Winfried Magerl - Internet Administration
    Siemens Business Services, 81739 Munich, Germany
    Internet-Mail: Winfried.Magerl@mch.sbs.de

  6. Re: why inter-changing pci slot works?

    On Thu, 28 Dec 2006 07:29:36 +0530 Himanshu Chauhan wrote:
    | David Schwartz wrote:
    |> Himanshu Chauhan wrote:
    |>
    |>> Hello group!
    |>>
    |>> Sometime it happens that two adjacent PCI cards don't work. But as you
    |>> interchange their slots. The pair starts working. Why is it so?
    |>>
    |>> Is it related to the priority of the IRQs?
    |>>
    |>> Thanks
    |>
    |>
    |>
    |> It would help if you were more specific. For example, when you say
    |> "interchange their slots" do you mean swap the two devices? Or move one
    |> of the devices to an empty slot? What devices?
    |>
    |> DS
    |>
    |
    | Okay, to be more specific sometimes back I had an internal modem card on
    | slot 1 and soundcard on slot 2. They didn't work with that arrangement.
    | I swapped the cards then and both of them were working. Recently, I put
    | the ethernet card in the second slot. It didn't work. I just changed its
    | position to the 3rd slot and it worked! This time it is the only card so
    | I think IRQ consideration is out of question. Right?

    It's definitely (still) time for a whole new computer I/O architecture
    design that does not involve interrupt identification separate from the
    device identity. The original IRQ was supposed to be a priority level
    on a very small machine with few devices. That's just a mess for today's
    needs. What we need is a machine with each device having a unique ID
    that spells out both it's memory address range as well as it's interrupt
    ID (being the same ID). Maybe that would be an ID bound to a slot or
    maybe it would be settable on the boards. The OS can then map those
    devices as needed.

    --
    |---------------------------------------/----------------------------------|
    | Phil Howard KA9WGN (ka9wgn.ham.org) / Do not send to the address below |
    | first name lower case at ipal.net / spamtrap-2006-12-28-0540@ipal.net |
    |------------------------------------/-------------------------------------|

  7. Re: why inter-changing pci slot works?

    "David Schwartz" writes:

    [...]

    > 1) One of the slots shares an IRQ with an on-board device, and the
    > drivers of the on-board device and the card you put in that slot can't
    > cooperate.
    >
    > 2) The two slots share an IRQ with each other, and the two devices
    > can't cooperate.


    PCI IRQ sharing is generic and handled at the driver level. And
    drivers for all PCI devices must handle this. So, either the slot or
    the driver is likely broken.

  8. Re: why inter-changing pci slot works?


    phil-news-nospam@ipal.net wrote:

    > It's definitely (still) time for a whole new computer I/O architecture
    > design that does not involve interrupt identification separate from the
    > device identity. The original IRQ was supposed to be a priority level
    > on a very small machine with few devices. That's just a mess for today's
    > needs. What we need is a machine with each device having a unique ID
    > that spells out both it's memory address range as well as it's interrupt
    > ID (being the same ID). Maybe that would be an ID bound to a slot or
    > maybe it would be settable on the boards. The OS can then map those
    > devices as needed.


    I believe this is precisely what MSI does (message signaled
    interrupts).

    http://lwn.net/Articles/44139/

    DS


  9. Re: why inter-changing pci slot works?

    "David Schwartz" writes:
    > phil-news-nospam@ipal.net wrote:
    >
    >> It's definitely (still) time for a whole new computer I/O architecture
    >> design that does not involve interrupt identification separate from the
    >> device identity. The original IRQ was supposed to be a priority level
    >> on a very small machine with few devices. That's just a mess for today's
    >> needs. What we need is a machine with each device having a unique ID
    >> that spells out both it's memory address range as well as it's interrupt
    >> ID (being the same ID). Maybe that would be an ID bound to a slot or
    >> maybe it would be settable on the boards. The OS can then map those
    >> devices as needed.

    >
    > I believe this is precisely what MSI does (message signaled
    > interrupts).


    Not quite (actually, not at all ;-). A traditional PCI device has up
    to four interrupt pins (A, B, C, D) and uses them to signal interrupts
    to the host as level-triggered active low. This means they can be
    shared easily, because there is no risk to 'lose' and interrupt while
    serving another (the pin of each device currently signalling an
    interrupt will remain low until reset by host software). But the
    'messy' part comes after that: A system typically has an interrupt
    controller of some nature (and traditional PCs are exceptionally
    grotty in this respect) which aggegrates interrupt inputs from a
    number of different source (like PCI IRQ pins) and is cable of
    actually interrupting the host CPU. If this happens, host software
    must read some kind of status register to determine which set of
    sources are currently interrupting (typically represented as bitmap
    with the position of a bit in this bitmap being the IRQ number) and
    demultiplex the input event set to a set of device drivers.

    The interrupt controller can support only a limited amount of
    different interrupt sources. On system startup, host software
    enumerates the present PCI devices and assigns interrupt numbers to
    them 'somehow' (eg on our newer hardware, the core does not provide a
    'direct' connection between PCI IRQ inputs and the interrupt
    controller, so the respective pins need to be connected to available
    GPIO pins of the core, which, in turn, can functions as inputs to the
    interrupt controller). The assigned interrupt numbers are stored in the
    'interrupt line register' in the PCI configuration space of each
    device and the device drivers are supposed to read them from there and
    to inform the host operating system that driver soandso should be
    'activated' if IRQ #n is active. The driver is supposed to determine
    if it was 'his' device that interrupted and if it was, do something to
    make the interrupt condition disappear on this device. Afterwards, if
    the condition persists, the next driver that registered itself for the
    IRQ number in question is activated and so on.

    The difference between MSI and traditional PCI IRQs is that, instead
    of being delivered as out-of-band signal using dedicated circuitry,
    an interrupt condition is signalled by doing an inbound (from device
    to host) memory write over the PCI to a specific
    address. Responsibility for assigning unique addresses to each device
    rests with the host software. But this transports the interrupt event
    only to the PCI controller (or whatever component feels itself
    addressed at this area of the physical memory map). There still needs
    to be some kind of 'interrupt controller' that can actually interrupt
    the CPU, with IRQ numbers that may be shared etc pp, meaning, while
    this is supposedly cheaper (less pins) it doesn't adresss the 'messy'
    part at all. And it isn't even theoretically real-time capable.

  10. Re: why inter-changing pci slot works?


    Rainer Weikusat wrote:

    > The difference between MSI and traditional PCI IRQs is that, instead
    > of being delivered as out-of-band signal using dedicated circuitry,
    > an interrupt condition is signalled by doing an inbound (from device
    > to host) memory write over the PCI to a specific
    > address. Responsibility for assigning unique addresses to each device
    > rests with the host software. But this transports the interrupt event
    > only to the PCI controller (or whatever component feels itself
    > addressed at this area of the physical memory map). There still needs
    > to be some kind of 'interrupt controller' that can actually interrupt
    > the CPU, with IRQ numbers that may be shared etc pp, meaning, while
    > this is supposedly cheaper (less pins) it doesn't adresss the 'messy'
    > part at all. And it isn't even theoretically real-time capable.


    I think you are equating the problem MSI solves with a totally
    different problem that MSI does not solve. MSI solves the problem of
    assigning, identifying, and possibly running out of interrupts to
    devices in PCI and PCI-E slots. It does not solve the problem of
    assigning, identifying, and possibly running out of interrupts for bus
    controllers. A system will typically have a limited, fixed number of
    bus controllers, so this really isn't a problem -- sharing IRQs
    shouldn't be necessary.

    So I disagree that it doesn't address the messy part. It addresses it
    and solves it. There should be no need to assign or share IRQs based on
    added hardware in a system that can use MSI for all its devices.

    However, I do agree that MSI brings its own issues and isn't the
    greatest thing since sliced bread. I think its primary purpose is to
    save pins and therefore cost.

    DS


  11. Re: why inter-changing pci slot works?

    This is very nebulous, but I remember something in the BIOS of one or
    more of my computers that you could enable to have the BIOS rearrange
    something to do with the slots.
    --

    jhhaynes at earthlink dot net


  12. Re: why inter-changing pci slot works?

    "David Schwartz" writes:
    > Rainer Weikusat wrote:
    >> The difference between MSI and traditional PCI IRQs is that, instead
    >> of being delivered as out-of-band signal using dedicated circuitry,
    >> an interrupt condition is signalled by doing an inbound (from device
    >> to host) memory write over the PCI to a specific
    >> address. Responsibility for assigning unique addresses to each device
    >> rests with the host software. But this transports the interrupt event
    >> only to the PCI controller (or whatever component feels itself
    >> addressed at this area of the physical memory map). There still needs
    >> to be some kind of 'interrupt controller' that can actually interrupt
    >> the CPU, with IRQ numbers that may be shared etc pp, meaning, while
    >> this is supposedly cheaper (less pins) it doesn't adresss the 'messy'
    >> part at all. And it isn't even theoretically real-time capable.

    >
    > I think you are equating the problem MSI solves with a totally
    > different problem that MSI does not solve. MSI solves the problem of
    > assigning, identifying, and possibly running out of interrupts to
    > devices in PCI and PCI-E slots.


    'Possibly running out of interrupts' is an issue because of
    limitations of an interrupt controller. And the 'assigned interrupt'
    is just an eight bit quantity which as no meaning to the PCI device
    itself. With MSI, instead of assigning a number to be used for routing
    device requests to device drivers, host software must assign unique
    message adresses and 'message data items' to devices. If anything,
    this is more complicated and not less complicated than the traditional
    scheme.

    > It does not solve the problem of assigning, identifying, and
    > possibly running out of interrupts for bus controllers. A system
    > will typically have a limited, fixed number of bus controllers, so
    > this really isn't a problem -- sharing IRQs shouldn't be necessary.


    There is nothing that prevents bus controllers from acting
    as 2nd level interrupt controllers for the devices on 'their' bus. But
    while this would make IRQ handling by the host OS technically more
    complicated, all problems wrt demultiplexing interrupt inputs from an
    arbitrary number of arbitrary different devices would still be there.

    > So I disagree that it doesn't address the messy part. It addresses
    > it and solves it. There should be no need to assign or share IRQs
    > based on added hardware in a system that can use MSI for
    > all its devices.


    As long as there is an interrupt controller which supports a fixed set
    of interrupt sources, the same interrupt number may need to be used
    for different 'functions'. Taking your description from above as an
    example, there would be only one interrupt output for the whole bus,
    meaning all devices would share a single IRQ and, because the bus
    controller cannot have an unlimited amount of memory to keep received
    messages until the host OS has processed them, there may even be
    'second level sharing' of message source identifiers (likely, numbers
    as well) in the bus controller.

  13. Re: why inter-changing pci slot works?

    Himanshu Chauhan wrote in part:
    > Okay, to be more specific sometimes back I had an internal modem
    > card on slot 1 and soundcard on slot 2. They didn't work with
    > that arrangement. I swapped the cards then and both of them
    > were working. Recently, I put the ethernet card in the second
    > slot. It didn't work. I just changed its position to the 3rd
    > slot and it worked! This time it is the only card so I think
    > IRQ consideration is out of question. Right?


    In addition to IRQ clashes (that should be handled by
    well-coded device drivers), some PCI slots are BusMaster
    (DMA) capable and some are not, depending on the quality of
    the motherboard. Device drivers also need to consider this.

    Although frankly, a high throughput card like an ethercard,
    HD controller (or soundcards??) really needs BusMastering
    or the system will bog down with the CPU handling IO.

    -- Robert


+ Reply to Thread