On entry, a HwInterrupt routine should determine if its HBA actually generated an interrupt. HwInterrupt must return FALSE as soon as possible if it detects a spurious interrupt so the interrupt service routine for the device that generated the interrupt can be called quickly.
Otherwise, a miniport's HwInterrupt routine is generally responsible for completing the I/O operation that caused the interrupt. Depending on the HBA and the design of the miniport, a HwInterrupt routine does some or all of the following:
When the HwInterrupt routine (or an internal miniport routine) completes an SRB, it calls ScsiPortNotification twice:
For better overall system performance, a miniport's HwInterrupt routine should do only the minimum necessary to process I/O requests. That is, the miniport should be designed to return control from the HwInterrupt routine as quickly as possible, rather than tying up a processor and preventing other drivers from servicing device interrupts.
If interrupt-driven I/O operations take a long time to complete, a miniport driver should have a pair of HwEnableInterruptsCallback and HwDisableInterruptsCallback routines. For example, if a miniport must poll for longer than 50 microseconds doing PIO, its HwInterrupt routine should not retain control of the CPU for the full polling interval in order to complete a requested operation. Instead, its HwInterrupt routine should do the following:
ScsiPortNotification calls the HwEnableInterruptsCallback routine as an DPC.