On May 7, 2010, at 7:27 AM, Alan Stern wrote: > On Thu, 6 May 2010, Rob Duncan wrote: > >> A side-effect of the patch is that after the suspend a subsequent open() >> call fail with -EAGAIN. I added some tracing and see this: >> >> May 6 18:06:09 localhost kernel: exar 3-3:1.1: __pm_runtime_resume()! >> May 6 18:06:09 localhost kernel: exar 3-3:1.1: __pm_runtime_resume power.disable_depth=1 returning -EAGAIN >> May 6 18:06:09 localhost kernel: exar 3-3:1.1: __pm_runtime_resume() returns -11! >> May 6 18:06:09 localhost kernel: exar 3-3:1.1: __pm_runtime_idle power.usage_count=0 power.disable_depth=1 power.runtime_status=2 >> May 6 18:06:09 localhost kernel: exar 3-3:1.1: usb_autopm_get_interface: cnt 0 -> -11 >> >> With disable_depth == 1 the call to pm_runtime_resume() fails with -EAGAIN. >> Is there some sequence of calls I should make in my driver probe or attach >> that will make the patch unnecessary? > > I don't understand. The disable_depth value should be 0 -- the patch > sets it to 0 by means of the call to pm_runtime_enable() added in > usb_probe_interface(). Can you check at that spot to see if it really > does what it's supposed to do? I added a trace immediately after the call to pm_runtime_enable() in usb_probe_interface(). It dumps the value of disable_depth of the device (the interface), and also the interface's parent device (the USB device itself). Here's what I see: May 7 08:42:03 localhost kernel: usb 3-3: adding 3-3:1.1 (config #1, interface 1) May 7 08:42:03 localhost kernel: usbserial_generic 3-3:1.1: usb_probe_interface May 7 08:42:03 localhost kernel: usbserial_generic 3-3:1.1: usb_probe_interface - got id May 7 08:42:03 localhost kernel: usb 3-3: usb_autoresume_device: cnt 5 -> 1 May 7 08:42:03 localhost kernel: usbserial_generic 3-3:1.1: usb_probe_interface dev->power.disable_depth=1 May 7 08:42:03 localhost kernel: usb 3-3: usb_probe_interface dev->parent->power.disable_depth=0 May 7 08:42:03 localhost kernel: usb 3-3: usb_autosuspend_device: cnt 4 -> 0 May 7 08:42:03 localhost kernel: exar 3-3:1.1: usb_probe_interface May 7 08:42:03 localhost kernel: exar 3-3:1.1: usb_probe_interface - got id May 7 08:42:03 localhost kernel: usb 3-3: usb_autoresume_device: cnt 5 -> 1 May 7 08:42:03 localhost kernel: exar 3-3:1.1: usb_probe_interface dev->power.disable_depth=1 May 7 08:42:03 localhost kernel: usb 3-3: usb_probe_interface dev->parent->power.disable_depth=0 It looks like the interface is being probed twice, which I don't understand. But in each case the interface has disable_depth set and the parent doesn't. Rob. The information and any attached documents contained in this message may be confidential and/or legally privileged. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, dissemination, or reproduction is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender immediately by return e-mail and destroy all copies of the original message. -- 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