| 
      
      
      From: Dan E. <Dan...@ne...> - 2006-06-02 15:24:56
      
     | 
| After much exploration I've discovered the cause of the inability for
some laptops to coming out of standby is.
=20
The power irp for changing device state is being issued in the
completion routine for the system power irp, and then the thread is
blocked waiting for the device power irp to complete.
=20
Before the blocking takes place, the power manager attempts to send the
irp all the way, the power dispatcher sees the device power irp, and
tries to send it down the stack, but the usbhub below returns status
pending so the completion handler isn't called at that point.
=20
The libusb thread then blocks waiting for the irp to complete, but it
never does because the thread which would go on to call the completion
routing is being blocked!
=20
Replacing the call to on_power_set_device_state_complete with :
=20
power_state.DeviceState =3D
dev->device_power_states[power_state.SystemState];
/* set the device power state and don't wait for completion */
(void) PoRequestPowerIrp(dev->physical_device_object,=20
                         IRP_MN_SET_POWER,=20
                         power_state,
                         NULL,
                         NULL, NULL);
Seems to resolve the problem.
I've attached this as a patch.
Comments?
Cheers,
=20
--=20
Dan Ellis
Newnham Research
 |