Changeset 55058 in vbox for trunk/src/VBox/HostDrivers/VBoxUSB/win
- Timestamp:
- Mar 31, 2015 10:29:00 PM (10 years ago)
- Location:
- trunk/src/VBox/HostDrivers/VBoxUSB/win
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxUSB/win/cmn/VBoxDrvTool.cpp
r38356 r55058 188 188 Interval.QuadPart = -(int64_t) 2 /* ms */ * 10000; 189 189 uint32_t cRefs; 190 191 while ((cRefs = ASMAtomicReadU32(&pRef->cRefs)) != u32Val) 190 size_t loops = 0; 191 KTIMER kTimer; 192 NTSTATUS status = STATUS_SUCCESS; 193 194 KeInitializeTimer(&kTimer); 195 196 while ((cRefs = ASMAtomicReadU32(&pRef->cRefs)) > u32Val && loops < 256) 192 197 { 193 198 Assert(cRefs >= u32Val); 194 199 Assert(cRefs < UINT32_MAX/2); 195 200 196 KeDelayExecutionThread(KernelMode, FALSE, &Interval); 201 KeSetTimer(&kTimer, Interval, NULL); 202 status = KeWaitForSingleObject(&kTimer, Executive, KernelMode, false, NULL); 203 Assert(NT_SUCCESS(status)); 204 loops++; 197 205 } 198 206 } -
trunk/src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUsbDev.h
r49137 r55058 190 190 } 191 191 192 static DECLHIDDEN(VOID) vboxUsbDdiStateWaitOtherCompleted(PVBOXUSBDEV_EXT pDevExt)193 {194 /* Earlier we assumed that 1 request will be pending while we service195 Device Power IRP which was leading to host hang when USB is connected196 to VM.197 With debugging found that at the point when host goes to sleep198 state and USB is connected to VM, two Power IRP requests are pending :199 One for SYSTEM and other for DEVICE.200 */201 VBoxDrvToolRefWaitEqual(&pDevExt->DdiState.Ref, 3);202 }203 204 192 #endif /* #ifndef ___VBoxUsbDev_h___ */ -
trunk/src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUsbPnP.cpp
r36968 r55058 70 70 ENMVBOXUSB_PNPSTATE enmState = vboxUsbPnPStateGet(pDevExt); 71 71 NTSTATUS Status = STATUS_SUCCESS; 72 if (enmState == ENMVBOXUSB_PNPSTATE_STOP_PENDING) 73 { 74 IoCopyCurrentIrpStackLocationToNext(pIrp); 75 Status = VBoxDrvToolIoPostSync(pDevExt->pLowerDO, pIrp); 76 if (NT_SUCCESS(Status)) 77 { 78 vboxUsbPnPStateRestore(pDevExt); 79 } 80 } 81 else 82 { 83 Assert(0); 84 Assert(enmState == ENMVBOXUSB_PNPSTATE_STARTED); 85 } 86 72 73 IoCopyCurrentIrpStackLocationToNext(pIrp); 74 Status = VBoxDrvToolIoPostSync(pDevExt->pLowerDO, pIrp); 75 if (NT_SUCCESS(Status) && enmState == ENMVBOXUSB_PNPSTATE_STOP_PENDING) 76 { 77 vboxUsbPnPStateRestore(pDevExt); 78 } 79 80 Status = STATUS_SUCCESS; 87 81 VBoxDrvToolIoComplete(pIrp, Status, 0); 88 82 vboxUsbDdiStateRelease(pDevExt); … … 144 138 ENMVBOXUSB_PNPSTATE enmState = vboxUsbPnPStateGet(pDevExt); 145 139 NTSTATUS Status = STATUS_SUCCESS; 146 if (enmState == ENMVBOXUSB_PNPSTATE_REMOVE_PENDING) 147 { 148 IoCopyCurrentIrpStackLocationToNext(pIrp); 149 Status = VBoxDrvToolIoPostSync(pDevExt->pLowerDO, pIrp); 150 if (NT_SUCCESS(Status)) 151 { 152 vboxUsbPnPStateRestore(pDevExt); 153 } 154 } 155 else 156 { 157 Assert(0); 158 Assert(enmState == ENMVBOXUSB_PNPSTATE_STARTED); 159 } 160 140 IoCopyCurrentIrpStackLocationToNext(pIrp); 141 142 Status = VBoxDrvToolIoPostSync(pDevExt->pLowerDO, pIrp); 143 144 if (NT_SUCCESS(Status) && 145 enmState == ENMVBOXUSB_PNPSTATE_REMOVE_PENDING) 146 { 147 vboxUsbPnPStateRestore(pDevExt); 148 } 149 150 Status = STATUS_SUCCESS; 161 151 VBoxDrvToolIoComplete(pIrp, Status, 0); 162 152 vboxUsbDdiStateRelease(pDevExt); -
trunk/src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUsbPwr.cpp
r36968 r55058 210 210 PIRP pIrp = pCtx->pIrp; 211 211 212 vboxUsbDdiStateWaitOtherCompleted(pDevExt);213 214 212 vboxUsbPwrIoPostDev(pDevExt, pIrp); 215 213
Note:
See TracChangeset
for help on using the changeset viewer.