Interrupt Synchronization - WDF driver



Hi,

I am getting interrupt synchronization problems for my PCI device WDF driver
in SMP pc's, would like to hear the best solutions for interrupt
synchronization.

In multiprocessor(SMP) pc's, i have experienced that, when multiple
interrups generated for my device, interrupts are not recognised & serviced
properly by my DPC's, but it is working fine in single processor PC's.

using one H/W PCI interrupt(Not shared ), my pci device supports 10 software
interrupts using different enable registers. Int handler checks the interrupt
for my device or not and accordinlgly schedules the DPC's for further
interrupt processing.
In DPC's, some of the device hardware registers will be accessed and shall
be set/clear them accordingly.

In SMP pc's, while generating multiple interrupts continuosly in very short
intervals, observed that, only one interrupt was serviced correctly & rest
are not(bits got disabled for those interrupts).

To overcome this Multiple DPC synchronization & (b/w DPC, other Device
IOCTL's) synchronization, i have used WdfInterruptAcquireLock. Afer using
this, 90% of the times it is working fine, but success rate is not 100%.

Sometimes, while repeating the tests for multiple times, after few tests,
problem is coming again(I am thinking that, it is coming may be, it is
missing some interrupts?).

What i understood is, to synchronize b/w multiple DPC's, b/w DPC & other
therads, spinlock wont be helpful ,only WdfInterruptAcquireLock can do that
better.

Where as, previous version of this driver was developed in NT model, using
IoConnectInterrupt, interrupts are serviced, here, w/o any synchronization
methods, this is working fine for above tests in SMP pc's.

Is Interrupts DPC's handling is sequential for SMP pc's also for NT model? I
guess, in WDF model, SMP pc's, DPC scheduling is simulataneous based upon
processor availability, is this is true?

Is it possible to schedule the DPC's in WDF driver one after other in SMP
pc's also?, any option available?

Is there any other precautions to be taken to achieve 100% interrupt
synchronization?



Thanks,
Kota


.



Relevant Pages

  • Re: In the Shallow End
    ... a nasty flaw; the completion procedures act ... like interrupts, transfering control to your ... But normal synchronization primitives don't ... these are like normal blocking operations ...
    (comp.sys.mac.advocacy)
  • Re: In the Shallow End
    ... This was a great feature of VMS. ... a nasty flaw; the completion procedures act ... like interrupts, transfering control to your ... But normal synchronization primitives don't ...
    (comp.sys.mac.advocacy)
  • Re: [patch 00/21] mutex subsystem, -V14
    ... >> need it, since DMA will never matter, and interrupts are precise. ... > I think the isync is necessary to keep heavily out of order processors ... the asm/spinlock.h ops are only built on SMP kernels. ... On UP the only synchronization needed is when a device reads/writes ...
    (Linux-Kernel)
  • Re: Software Optimization Guide for AMD Family 10h Processors
    ... And I am 100% sure that all SPARC SMP systems ever ... This can also happen for certain high-priority asynchronous interrupts, ... To your information, Intel-made Itanium chipsets ... Even these chipsets are now mostly obsolete and soon EOLed. ...
    (comp.arch)
  • Re: [PATCH] Re: Bad network performance over 2Gbps
    ... The IRQBALANCE option causes interrupts to bounce all around on SMP ... quickly burying the CPU in migration cost and cache misses. ... I agree that having a full-featured userspace balancer daemon with lots of ...
    (Linux-Kernel)