The documentation for StorPortAcquireSpinLock states that ScsiStopAdapter cannot acquire any lock. The function (at least under W2K8) is called at PASSIVE_LEVEL. Can I assume that interrupts are disabled this late in the driver?
Does anybody know if the IRQL is the same in earlier version, and for scsiport as well?
>The documentation for StorPortAcquireSpinLock states that ScsiStopAdapter cannot acquire any >lock.
When ScsiStopAdapter called the driver already hold Interrupt lock. It does not make sense acquire another lock.
Can I assume that interrupts are disabled this late in the driver?
The interrupt should be disabled during the processing of ScsiStopAdapter in HwAdapterControlRoutine routine.
Does anybody know if the IRQL is the same in earlier version, and for scsiport as well?
I think it should be the same IRQL including scsiport but you need to verify.
Igor Sharovar
> When ScsiStopAdapter called the driver already hold Interrupt lock. It does not make sense
acquire another lock.
This is against MS docs at http://msdn.microsoft.com/en-us/library/ff567025(VS.85).aspx which say
HwAdapterControlRoutine
Spin lock held by port driver: None
Note: In Windows Server 2003, the StartIo spin lock was held when control type is ScsiStopAdapter.
Also, shouldn’t it be at DIRQL then (I checked both !irql and cr8, and both confirm it’s called at PASSIVE_LEVEL)?
And finally, I traced through storport; the call to the HwStorAdapterControl is wrapped with internal functions making up an acquire/release pair, but they are actually doing nothing. Still, it makes sense that interrupts disabled cause the interrupt lock acquire/release to become no-ops.
>This is against MS docs at http://msdn.microsoft.com/en-us/library/ff567025(VS.85).aspx
It is strange because I referenced to the documentation of StorPortAcquireSpinLock in WDK 7600.16385.1.
It explicitly says that ScsiStopAdapter called with Interrupt lock and does not say anything about Win2003.
"
HwAdapterControlRoutine
None
(Interrupt when control type is ScsiStopAdapter)
"
Still, it makes sense that interrupts disabled cause the interrupt lock acquire/release to become >no-ops.
It doesn’t matter how Interrupt lock implemented. The more important is what you could do in ScsiStopAdapter. The documentation, which is the same for storport and scsiport, says that
"ControlType
ScsiStopAdapter
…
The miniport driver disables interrupts on its HBA,
"
http://msdn.microsoft.com/en-us/library/ff557274(v=VS.85).aspx
If a miniport could disable HBA interrupt it means it must hold Interrupt lock. But I am confuse about Win2003. It could be a documentation error. You need to ask Microsoft about it.
Igor Sharovar
Is it virtual miniport or non-virtual?
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com
wrote in message news:xxxxx@ntdev…
> The documentation for StorPortAcquireSpinLock states that ScsiStopAdapter cannot acquire any lock. The function (at least under W2K8) is called at PASSIVE_LEVEL. Can I assume that interrupts are disabled this late in the driver?
>
> Does anybody know if the IRQL is the same in earlier version, and for scsiport as well?
>
SCSIPORT loves DIRQL. It is (or meant to be) idiot-proof.
Calvin
wrote in message news:xxxxx@ntdev…
> The documentation for StorPortAcquireSpinLock states that ScsiStopAdapter
cannot acquire any lock. The function (at least under W2K8) is called at
PASSIVE_LEVEL. Can I assume that interrupts are disabled this late in the
driver?
>
> Does anybody know if the IRQL is the same in earlier version, and for
scsiport as well?
>
—
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
> Is it virtual miniport or non-virtual?
Sorry for the late reply. It is non-virtual.