On May 6, 2010, at 7:06 AM, Alan Stern wrote: > Okay, I see what the problem is. It's a subtle thing, involving the > difference between the runtime PM state and the usage_count. It also > involves what the driver does: If it doesn't ever call > usb_autopm_get_interface() or usb_autopm_put_interface(), should the > device be autosuspended? > > I guess it should. This patch ought to fix the problem. Thanks, Alan. The patch does fix that problem, and uncovers the next one :-) Now I get as far as autosuspend_check() looking to see whether the device has been idle long enough to actually do the suspend. Something is causing last_busy to increase, so the check is always failing. last_busy increments very regularly by almost exactly one second every time. May 6 12:33:53 localhost kernel: usb 3-3: __pm_runtime_resume()! May 6 12:33:53 localhost kernel: usb 3-3: __pm_runtime_resume() returns 1! May 6 12:33:53 localhost kernel: usb 3-3: usb_autoresume_device: cnt 1 -> 1 May 6 12:33:53 localhost kernel: usb 3-3: usb_autoresume_device intf 0 usage_count=0 May 6 12:33:53 localhost kernel: usb 3-3: usb_autoresume_device intf 1 usage_count=0 May 6 12:33:53 localhost kernel: usb 3-3: autosuspend_check do_remote_wakeup=0 May 6 12:33:53 localhost kernel: usb 3-3: autosuspend_check intf0.dev.power.disable_depth=0 May 6 12:33:53 localhost kernel: usb 3-3: autosuspend_check intf1.dev.power.disable_depth=0 May 6 12:33:53 localhost kernel: usb 3-3: autosuspend_check time_before j=4294839654 last_busy=4294839654 autosuspend_delay=2000 suspend_time=4294841654 May 6 12:33:53 localhost kernel: usb 3-3: usb_autosuspend_device: cnt 0 -> 0 May 6 12:33:53 localhost kernel: usb 3-3: usb_autosuspend_device intf 0 usage_count=0 May 6 12:33:53 localhost kernel: usb 3-3: usb_autosuspend_device intf 1 usage_count=0 May 6 12:33:54 localhost kernel: usb usb3: __pm_runtime_resume()! May 6 12:33:54 localhost kernel: usb usb3: __pm_runtime_resume() returns 1! May 6 12:33:54 localhost kernel: usb usb3: usb_autoresume_device: cnt 1 -> 1 May 6 12:33:54 localhost kernel: usb usb3: usb_autoresume_device intf 0 usage_count=0 May 6 12:33:54 localhost kernel: usb usb3: __pm_runtime_idle !pm_children_suspended power.usage_count=0 power.ignore_children=0 power.child_count=1 May 6 12:33:54 localhost kernel: usb usb3: usb_autosuspend_device: cnt 0 -> -16 May 6 12:33:54 localhost kernel: usb usb3: usb_autosuspend_device intf 0 usage_count=0 May 6 12:33:54 localhost kernel: usb 3-3: __pm_runtime_resume()! May 6 12:33:54 localhost kernel: usb 3-3: __pm_runtime_resume() returns 1! May 6 12:33:54 localhost kernel: usb 3-3: usb_autoresume_device: cnt 1 -> 1 May 6 12:33:54 localhost kernel: usb 3-3: usb_autoresume_device intf 0 usage_count=0 May 6 12:33:54 localhost kernel: usb 3-3: usb_autoresume_device intf 1 usage_count=0 May 6 12:33:54 localhost kernel: usb 3-3: autosuspend_check do_remote_wakeup=0 May 6 12:33:54 localhost kernel: usb 3-3: autosuspend_check intf0.dev.power.disable_depth=0 May 6 12:33:54 localhost kernel: usb 3-3: autosuspend_check intf1.dev.power.disable_depth=0 May 6 12:33:54 localhost kernel: usb 3-3: autosuspend_check time_before j=4294839654 last_busy=4294839654 autosuspend_delay=2000 suspend_time=4294841654 May 6 12:33:54 localhost kernel: usb 3-3: usb_autosuspend_device: cnt 0 -> 0 May 6 12:33:54 localhost kernel: usb 3-3: usb_autosuspend_device intf 0 usage_count=0 May 6 12:33:54 localhost kernel: usb 3-3: usb_autosuspend_device intf 1 usage_count=0 May 6 12:33:54 localhost kernel: usb usb3: __pm_runtime_resume()! May 6 12:33:54 localhost kernel: usb usb3: __pm_runtime_resume() returns 1! May 6 12:33:54 localhost kernel: usb usb3: usb_autoresume_device: cnt 1 -> 1 May 6 12:33:54 localhost kernel: usb usb3: usb_autoresume_device intf 0 usage_count=0 May 6 12:33:54 localhost kernel: usb usb3: __pm_runtime_idle !pm_children_suspended power.usage_count=0 power.ignore_children=0 power.child_count=1 May 6 12:33:54 localhost kernel: usb usb3: usb_autosuspend_device: cnt 0 -> -16 May 6 12:33:54 localhost kernel: usb usb3: usb_autosuspend_device intf 0 usage_count=0 ... May 6 12:33:54 localhost kernel: usb 3-3: __pm_runtime_resume()! May 6 12:33:54 localhost kernel: usb 3-3: __pm_runtime_resume() returns 1! May 6 12:33:54 localhost kernel: usb 3-3: usb_autoresume_device: cnt 1 -> 1 May 6 12:33:55 localhost kernel: usb 3-3: usb_autoresume_device intf 0 usage_count=0 May 6 12:33:55 localhost kernel: usb 3-3: usb_autoresume_device intf 1 usage_count=0 May 6 12:33:55 localhost kernel: usb 3-3: autosuspend_check do_remote_wakeup=0 May 6 12:33:55 localhost kernel: usb 3-3: autosuspend_check intf0.dev.power.disable_depth=0 May 6 12:33:55 localhost kernel: usb 3-3: autosuspend_check intf1.dev.power.disable_depth=0 May 6 12:33:55 localhost kernel: usb 3-3: autosuspend_check time_before j=4294840656 last_busy=4294840656 autosuspend_delay=2000 suspend_time=4294842656 May 6 12:33:55 localhost kernel: usb 3-3: usb_autosuspend_device: cnt 0 -> 0 May 6 12:33:55 localhost kernel: usb 3-3: usb_autosuspend_device intf 0 usage_count=0 May 6 12:33:55 localhost kernel: usb 3-3: usb_autosuspend_device intf 1 usage_count=0 May 6 12:33:55 localhost kernel: usb usb3: __pm_runtime_resume()! May 6 12:33:55 localhost kernel: usb usb3: __pm_runtime_resume() returns 1! May 6 12:33:55 localhost kernel: usb usb3: usb_autoresume_device: cnt 1 -> 1 May 6 12:33:55 localhost kernel: usb usb3: usb_autoresume_device intf 0 usage_count=0 May 6 12:33:55 localhost kernel: usb usb3: __pm_runtime_idle !pm_children_suspended power.usage_count=0 power.ignore_children=0 power.child_count=1 May 6 12:33:55 localhost kernel: usb usb3: usb_autosuspend_device: cnt 0 -> -16 May 6 12:33:55 localhost kernel: usb usb3: usb_autosuspend_device intf 0 usage_count=0 May 6 12:33:55 localhost kernel: usb 3-3: __pm_runtime_resume()! May 6 12:33:55 localhost kernel: usb 3-3: __pm_runtime_resume() returns 1! May 6 12:33:55 localhost kernel: usb 3-3: usb_autoresume_device: cnt 1 -> 1 May 6 12:33:55 localhost kernel: usb 3-3: usb_autoresume_device intf 0 usage_count=0 May 6 12:33:55 localhost kernel: usb 3-3: usb_autoresume_device intf 1 usage_count=0 May 6 12:33:55 localhost kernel: usb 3-3: autosuspend_check do_remote_wakeup=0 May 6 12:33:55 localhost kernel: usb 3-3: autosuspend_check intf0.dev.power.disable_depth=0 May 6 12:33:55 localhost kernel: usb 3-3: autosuspend_check intf1.dev.power.disable_depth=0 May 6 12:33:55 localhost kernel: usb 3-3: autosuspend_check time_before j=4294840656 last_busy=4294840656 autosuspend_delay=2000 suspend_time=4294842656 May 6 12:33:55 localhost kernel: usb 3-3: usb_autosuspend_device: cnt 0 -> 0 May 6 12:33:55 localhost kernel: usb 3-3: usb_autosuspend_device intf 0 usage_count=0 May 6 12:33:55 localhost kernel: usb 3-3: usb_autosuspend_device intf 1 usage_count=0 May 6 12:33:55 localhost kernel: usb usb3: __pm_runtime_resume()! May 6 12:33:55 localhost kernel: usb usb3: __pm_runtime_resume() returns 1! May 6 12:33:55 localhost kernel: usb usb3: usb_autoresume_device: cnt 1 -> 1 May 6 12:33:55 localhost kernel: usb usb3: usb_autoresume_device intf 0 usage_count=0 May 6 12:33:55 localhost kernel: usb usb3: __pm_runtime_idle !pm_children_suspended power.usage_count=0 power.ignore_children=0 power.child_count=1 May 6 12:33:55 localhost kernel: usb usb3: usb_autosuspend_device: cnt 0 -> -16 May 6 12:33:55 localhost kernel: usb usb3: usb_autosuspend_device intf 0 usage_count=0 I'm trying to see what might be updating last_busy, but I'm having trouble seeing the "big picture". 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