none
Why WDF Interrupt handler is called over and over ? RRS feed

  • Question

  • Hi,

    I'm writing a PCIe kernel device driver using WDF framework.

    I wrote interrupt handler in DeviceAdd function as follows.

     

    ...
    // Create WDFINTERRUPT object.
    WDF_INTERRUPT_CONFIG_INIT(&xInterruptConfig, COWI_InterruptIsr, COWI_InterruptDpc);
    xInterruptConfig.EvtInterruptEnable  = COWI_InterruptEnable;
    xInterruptConfig.EvtInterruptDisable = COWI_InterruptDisable;
    
    xInterruptConfig.AutomaticSerialization = TRUE;
    
    status = WdfInterruptCreate(pDevice, &xInterruptConfig, WDF_NO_OBJECT_ATTRIBUTES, &(pExtContext->hInterrupt));
            ...


    Now, when my card generate interrupt, COWI_InterruptIsr function called by framework.

    But the problem is COWI_InterruptIsr function called over and over, though I return TRUE.

    MSDN document says that EvtInterrupt function must return TRUE if the function services the hardware interrupt.

    (https://msdn.microsoft.com/en-us/library/windows/hardware/ff541735(v=vs.85).aspx)

    I'm not sure whether I should do additional work to remove this interrupt request from the interrupt queue (that is, for no more COWI_InterruptIsr called),

    or my PCIe card does not handle this interrupt correctly.

    Regards,

    Samdori





    • Edited by Samdori Friday, September 2, 2016 3:46 PM
    Friday, September 2, 2016 3:44 PM

Answers

  • If your card is not clearing the interrupt (either because your driver is not telling it to do so, or there is a bug in the hardware) this is what will happen.  Also, if you return TRUE for the interrupt and it is not yours the same failure can happen.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Friday, September 2, 2016 4:40 PM