Changeset 55078 in vbox for trunk/src/VBox/HostDrivers/VBoxUSB
- Timestamp:
- Apr 1, 2015 2:50:42 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
r55058 r55078 188 188 Interval.QuadPart = -(int64_t) 2 /* ms */ * 10000; 189 189 uint32_t cRefs; 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) 190 191 while ((cRefs = ASMAtomicReadU32(&pRef->cRefs)) != u32Val) 197 192 { 198 193 Assert(cRefs >= u32Val); 199 194 Assert(cRefs < UINT32_MAX/2); 200 195 201 KeSetTimer(&kTimer, Interval, NULL); 202 status = KeWaitForSingleObject(&kTimer, Executive, KernelMode, false, NULL); 203 Assert(NT_SUCCESS(status)); 204 loops++; 196 KeDelayExecutionThread(KernelMode, FALSE, &Interval); 205 197 } 206 198 } -
trunk/src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUsbDev.h
r55058 r55078 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 service 195 Device Power IRP which was leading to host hang when USB is connected 196 to VM. 197 With debugging found that at the point when host goes to sleep 198 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 192 204 #endif /* #ifndef ___VBoxUsbDev_h___ */ -
trunk/src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUsbPnP.cpp
r55058 r55078 70 70 ENMVBOXUSB_PNPSTATE enmState = vboxUsbPnPStateGet(pDevExt); 71 71 NTSTATUS Status = STATUS_SUCCESS; 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; 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 81 87 VBoxDrvToolIoComplete(pIrp, Status, 0); 82 88 vboxUsbDdiStateRelease(pDevExt); … … 138 144 ENMVBOXUSB_PNPSTATE enmState = vboxUsbPnPStateGet(pDevExt); 139 145 NTSTATUS Status = STATUS_SUCCESS; 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; 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 151 161 VBoxDrvToolIoComplete(pIrp, Status, 0); 152 162 vboxUsbDdiStateRelease(pDevExt); -
trunk/src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUsbPwr.cpp
r55058 r55078 210 210 PIRP pIrp = pCtx->pIrp; 211 211 212 vboxUsbDdiStateWaitOtherCompleted(pDevExt); 213 212 214 vboxUsbPwrIoPostDev(pDevExt, pIrp); 213 215
Note:
See TracChangeset
for help on using the changeset viewer.