Generally, there are several things you can investigate. Here are some
random ideas off the top of my head…
For example, an erroneous driver sitting ahead of yours in the ISR chain
for that level, that fails to return FALSE if its device did not
interrupt, will block your ISR from ever seeing the interrupt.
(Historically, I know of at least one case in which this happened, as
described to me; the developer spent considerable time discovering this,
reported the bug to the vendor, who pointed out that they had fixed that
bug a year before).
One way to test this is to physically rearrange the cards on the
backplane. Sometimes this will cause the ISR chain to be developed in a
different order. In old systems, in guaranteed the ISR chain would be
different; in modern systems, PNP and Power Management can cause the ISR
chain to be developed non-deterministically, particularly when there are
different times for completion of PNP and Power sequencing. But this is
an unreliable diagnostic technique, because different physical
arrangements today could still produce the same ISR chain. If it *does*
make a difference, you have a pretty good idea that there is a broken
drive in the chain, but if it doesn’t make a difference, you have just
wasted time.
This also means that if you do not have *exactly* the same devices in your
Intel machine as your AMD machine, then you have a different set of
drivers, and one of them might be broken. Maybe. It is always worth
checking out. Perhaps one way to do this would be to load a software-only
driver that loads after everything else, and adds itself to the ISR chain.
I believe this puts it at the head of the chain. It would see all the
interrupts, check your device, and always return FALSE, then you would
have to examine this information (note that DbgPrint/KdPrint in an ISR can
change system behavior to the level that some devices will begin to fail,
so my inclination would be to log it to a circular buffer. This is a
fairly drsstic technique, and someone else is free to say it is the
dumbest idea they’ve ever heard.
I discovered some years ago that if I failed to call IoConnectInterrupt
properly (I don’t know the KMDF equivalent), then I would see on the debug
console a message that there was an unhandled interrupt on line XXXX. So
if you don’t get one of these messages, it means the interrupt has been
fielded and there is *something* in the ISR chain.
Are you checking all the return codes from the DDI calls? Could it be
that one one configuration, some call fails and you didn’t notice? Just a
thought.
Note that on-motherboard PCI devices are going to change the picture, and
I suspect that the CPU type is not the only difference between the
motherboards.
Discovering what devices are on each ISR chain might be worth researching.
joe
Okay,
I still haven’t figured out this problem. The system does work on a
AMD64 processor system but not on a INTEL processor system, at least,
that is the only specific difference between those computers (as what I
have at hand to test here.)
To clearify, Interrupt is only enabled upon writing a control word to
the DMA-register when starting a DMA transaction.
Further, the interrupt is disabled in the ISR, and DPC is triggered. At
this time, no new interrupt (from device) will occur
until current I/O Request is completed, and a new IRP triggers a new
DMA-transaction. A very simple approach for now to test the system.
I have implemented an IOCTL function where I check the DMA-register and
it clearly shows that the interrupt is set after DMA transaction has
occured. However, ISR routine is not triggered.
I initially mentioned we use MSI interrupt, but according to
CM_PARTIAL_RESOURCE_DESCRIPTOR its a LineInterrupt.
As I understand LineInterrupts (Legacy) are level-triggered interrupts
so shouldn’t the resource descriptor flag tell me exacly that when
testing for CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE, in my case it does
not?
Are there any WDF structures or places I may check if the OS actually
has received the interrupt, kind of like /etc/interrupt on linux?
-pfbach
On Fri, 2011-11-04 at 23:40 -0400, xxxxx@flounder.com wrote:
> See below…
> > Thnx Joseph, that was actually very helpful. It makes sence when I
> figured
> > out my driver wasn’t the only device on that IRQ. I didn’t think
> drivers
> > shared IRQ these days.
> *****
> It isn’t you choice, it is usually the BIOS/HAL combination that
> establishes this. For “pure PCI” (not message-based interrupts) sharing
> is still normal behavior.
> *****
> >
> > Gary, here is the setup of the IRQ that MyDriver is using:
> >
> > IRQ 16 MyDriver OK
> > IRQ 16 2nd generation Intel(R) Core™ processor family PCI Express
> > Controller - 0101 OK
> > IRQ 16 Intel(R) Management Engine Interface OK
> > IRQ 16 Intel(R) 6 Series/C200 Series Chipset Family PCI Express Root
> Port
> > 1 - 1C10 OK
> > IRQ 16 VIA 1394 OHCI Compliant Host Controller OK
> > IRQ 16 Intel(R) 6 Series/C200 Series Chipset Family PCI Express Root
> Port
> > 5 - 1C18 OK
> >
> > Seems like I may have gotten an interrupt from one of the Intel
> drivers
> > that I installed which made my driver think it was to continue (as the
> > dma-register show that interrupt bit is high (a check in the ISR
> routine
> > before taking any further action)).
> *******
> See the discussion below. Note that if you have not enabled for
> interrupts, but your device signals “status done”, and you got to your
> ISR
> because some other device interrupted, then it still works because
> interrupts are level-triggered, and presumably when you reset the device
> (there is usually a control bit called, for example, IACK, Interrupt
> ACKnowledge, which you use to tell the device to release its interrupt
> line). When you hit IACK, the I-am-interrupting or I/O-is-done bit will
> be cleared.
> ********
> >
> > Igor, I am not sure exacly what you mean by masking/unmasking the
> > Interrupt register.
> *****
> Most devices have an “interrupt enable” bit in the PCI control register
> set. Typically, you set this bit to 1 if you want to allow the device
> to
> interrupt. If it is not set, the device will not interrupt.
>
> Interrupts can be enabled across different spans. For example, enable
> on
> CreateFile and disable on Close. Or enable when an IRP is sent down,
> and
> disable after the interrupt is handled. Or even, enable on AddDevice
> and
> disable on IRP_MJ_PNP:IRP_MN_REMOVE (although this is highly unusual,
> very
> risky, and rarely makes sense for most devices). Most devices power-up
> with their IE bit set to 0, so they will not interrupt until you tell
> them
> they are allowed to.
>
> Most (well, all) PCI devices I’ve seen have some kind of
> interrupt-has-occurred or I/O-Operation-Completed bit in a status
> register. So what you do in your ISR is test this bit. If it isn’t
> your
> device, you ignore EVERYTHING the device might be telling you, and
> return
> FALSE immediately. You don’t care if it isn’t your device.
>
> For debugging purposes, you might look at DMA counters or other state,
> but
> such code would never be included in a product driver. If I’m doing
> something like this, I tend to do something like put a timestamped entry
> in an internal circular debug buffer, and have a debug-mode-only IOCTL
> that delivers this buffer back to an app, so I can examine it (I usually
> spend some time writing nice code to format and display it).
>
> You can get away with lots of things in development that you must not
> even
> consider putting in a product driver.
> joe
> ********************************************
> >
> > —
> > NTDEV is sponsored by OSR
> >
> > For our schedule of WDF, WDM, debugging and other seminars visit:
> > http://www.osr.com/seminars
> >
> > To unsubscribe, visit the List Server section of OSR Online at
> > http://www.osronline.com/page.cfm?name=ListServer
> >
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer