linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* One USB mouse problem with runtime power management enabled
@ 2013-07-03  2:43 Peter Chen
  2013-07-03 16:29 ` Alan Stern
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Chen @ 2013-07-03  2:43 UTC (permalink / raw)
  To: Jiri Kosina, Alan Stern
  Cc: linux-input-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA

Hi Jiri and Alan,

I have run below below at 3.5.7 kernel, but after checking upstream
kernel, it may also be existed.

1. evtest /dev/input/event1 &
2. Let mouse auto suspend, enable mouse as wakeup source, and let
the system enters suspend.
echo auto > /sys/bus/usb/devices/1-1/power/control

echo enabled > /sys/bus/platform/devices/2184000.usb/power/wakeup
echo enabled > /sys/bus/usb/devices/usb1/power/wakeup
echo enabled > /sys/bus/usb/devices/1-1/power/wakeup
echo enabled > /sys/bus/platform/devices/ci_hdrc.0/power/wakeup

sleep 3
echo mem > /sys/power/state

3. Resume system with USB mouse button.

4. Console output endless with below message
hub 1-0:1.0: port 1 nyet suspended
hub 1-0:1.0: usb_suspend_interface: status -16
usb usb1: usb_suspend_both: status -16

5. The reason for above message
After system goes to suspend, the roothub is RPM_SUSPENDED
At hub_events it will auto resume roothub, then auto suspend
roothub after system resumes. When it tries to auto suspend roothub,
it will print above message. But usbhid interface is resumed 
by system resume, so its can_submit is 1.

Unlike the USB Keyboard, the mouse doesn't have any event after system
resume, so it will not restart OUT/CTRL queues. So the USB mouse will
not do autoresume and autosuspend.

For hid keyboard, it has below message at its usb_hidinput_input_event
after system resume:
hid-generic 0003:413C:2105.0002: type:17, code:0, value:0
hid-generic 0003:413C:2105.0002: type:17, code:1, value:0
hid-generic 0003:413C:2105.0002: type:17, code:2, value:0
hid-generic 0003:413C:2105.0002: type:20, code:1, value:33
hid-generic 0003:413C:2105.0002: type:20, code:0, value:250

6. It will not affect evtest, but the USBHID mouse seems will not do
auto-resume/auto-suspend again even the mouse's button is pressed.
Then the USBHID has always been active (although it is RPM_SUSPENDED)

>From my point, this problem may need to be fixed:
1. At usbhid/input layer:
Since the usbhid device has auto suspended before system suspend, then,
it should still auto suspended after system resume.
2. At USB layer:
It can do auto resume and auto suspend USB device
after system resume to keep the usb device runtime pm status correct.

Thanks.

-- 

Best Regards,
Peter Chen

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-07-05  6:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-03  2:43 One USB mouse problem with runtime power management enabled Peter Chen
2013-07-03 16:29 ` Alan Stern
2013-07-04 10:22   ` Peter Chen
2013-07-04 14:55     ` Alan Stern
2013-07-05  6:46       ` Chen Peter-B29397

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).