mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-03 04:13:31 +00:00
[USBSTOR]
- Don't leave DISPATCH_LEVEL while holding a spin lock acquired at DISPATCH_LEVEL - Synchronize cancellation checking by acquiring the cancel spin lock svn path=/branches/usb-bringup/; revision=52071
This commit is contained in:
+23
-23
@@ -55,11 +55,6 @@ USBSTOR_CancelIo(
|
||||
//
|
||||
KeAcquireSpinLockAtDpcLevel(&FDODeviceExtension->IrpListLock);
|
||||
|
||||
//
|
||||
// now release the cancel lock
|
||||
//
|
||||
IoReleaseCancelSpinLock(Irp->CancelIrql);
|
||||
|
||||
//
|
||||
// remove the irp from the list
|
||||
//
|
||||
@@ -68,7 +63,12 @@ USBSTOR_CancelIo(
|
||||
//
|
||||
// release irp list lock
|
||||
//
|
||||
KeReleaseSpinLockFromDpcLevel(&FDODeviceExtension->IrpListLock);
|
||||
KeReleaseSpinLockFromDpcLevel(&FDODeviceExtension->IrpListLock);
|
||||
|
||||
//
|
||||
// now release the cancel lock
|
||||
//
|
||||
IoReleaseCancelSpinLock(Irp->CancelIrql);
|
||||
|
||||
//
|
||||
// set cancel status
|
||||
@@ -131,6 +131,21 @@ USBSTOR_QueueAddIrp(
|
||||
//
|
||||
FDODeviceExtension->IrpPendingCount++;
|
||||
|
||||
//
|
||||
// check if queue is freezed
|
||||
//
|
||||
IrpListFreeze = FDODeviceExtension->IrpListFreeze;
|
||||
|
||||
//
|
||||
// release list lock
|
||||
//
|
||||
KeReleaseSpinLock(&FDODeviceExtension->IrpListLock, OldLevel);
|
||||
|
||||
//
|
||||
// synchronize with cancellations by holding the cancel lock
|
||||
//
|
||||
IoAcquireCancelSpinLock(&Irp->CancelIrql);
|
||||
|
||||
//
|
||||
// now set the driver cancel routine
|
||||
//
|
||||
@@ -141,16 +156,6 @@ USBSTOR_QueueAddIrp(
|
||||
//
|
||||
if (Irp->Cancel && OldDriverCancel == NULL)
|
||||
{
|
||||
//
|
||||
// the irp has already been cancelled
|
||||
//
|
||||
KeReleaseSpinLock(&FDODeviceExtension->IrpListLock, OldLevel);
|
||||
|
||||
//
|
||||
// cancel routine requires that cancel spinlock is held
|
||||
//
|
||||
IoAcquireCancelSpinLock(&Irp->CancelIrql);
|
||||
|
||||
//
|
||||
// cancel irp
|
||||
//
|
||||
@@ -163,14 +168,9 @@ USBSTOR_QueueAddIrp(
|
||||
}
|
||||
|
||||
//
|
||||
// check if queue is freezed
|
||||
// release the cancel lock
|
||||
//
|
||||
IrpListFreeze = FDODeviceExtension->IrpListFreeze;
|
||||
|
||||
//
|
||||
// release list lock
|
||||
//
|
||||
KeReleaseSpinLock(&FDODeviceExtension->IrpListLock, OldLevel);
|
||||
IoReleaseCancelSpinLock(Irp->CancelIrql);
|
||||
|
||||
//
|
||||
// if list is freezed, dont start this packet
|
||||
|
||||
Reference in New Issue
Block a user