]> asedeno.scripts.mit.edu Git - linux.git/commit
USB: Report wakeup events on root-hub ports
authorAlan Stern <stern@rowland.harvard.edu>
Fri, 8 Jun 2018 20:59:37 +0000 (16:59 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Jun 2018 13:44:43 +0000 (21:44 +0800)
commit379cacc5e566f7197bdeb1ea3e99219d3e880c0a
treed391ffe22874bd321799b99c3e75c208dbd59fec
parent7daf201d7fe8334e2d2364d4e8ed3394ec9af819
USB: Report wakeup events on root-hub ports

When a USB device attached to a root-hub port sends a wakeup request
to a sleeping system, we do not report the wakeup event to the PM
core.  This is because a system resume involves waking up all
suspended USB ports as quickly as possible; without the normal
USB_RESUME_TIMEOUT delay, the host controller driver doesn't set the
USB_PORT_STAT_C_SUSPEND flag and so usb_port_resume() doesn't realize
that a wakeup request was received.

However, some environments (such as Chrome OS) want to have all wakeup
events reported so they can be ascribed to the appropriate device.  To
accommodate these environments, this patch adds a new routine to the
hub driver and a corresponding new HCD method to be used when a root
hub resumes.  The HCD method returns a bitmap of ports that have
initiated a wakeup signal but not yet completed resuming.  The hub
driver can then report to the PM core that the child devices attached
to these ports initiated a wakeup event.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Suggested-by: Anshuman Gupta <anshuman.gupta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hub.c
include/linux/usb/hcd.h