On Fri, May 2, 2014 at 12:09 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote: > On Thu, 1 May 2014, Dan Williams wrote: > >> I've been testing this and the pm_request_resume() ends up leaving the >> usb device enabled indefinitely. It needs to be paired with a >> pm_runtime_autosuspend(), but at that point why not just add a >> usb_autoresume_device_async() helper. > > Why didn't pm_request_resume() result in an autosuspend? Found it. The last thing pm_runtime_barrier() does is pm_runtime_put_noidle() which may cause the autosuspend timer to never be reset. The other bug I had was that my power down scripts were errant in unbinding the hub driver from 3rd level hubs. I now have the following in khubd before running port_event() and it is passing my initial tests (fixes the missed suspend mentioned above). Will hit it a bit harder with my tests and then re-submit the series. /* * Revalidate the device if it was requested by * usb_port_runtime_resume. */ if (test_and_clear_bit(i, hub->wakeup_bits) && udev) { pm_runtime_get_noresume(&udev->dev); pm_runtime_barrier(&udev->dev); pm_runtime_put_autosuspend(&udev->dev); } Thanks. -- Dan -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html