]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
usb: musb: fix remote wakeup racing with suspend
authorDaniel Glöckner <dg@emlix.com>
Mon, 14 May 2018 14:40:05 +0000 (09:40 -0500)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 1 Oct 2018 12:57:06 +0000 (14:57 +0200)
commit6fa9b21f5b98bb022651a377b0a2877c30d4285c
tree008124ed1f8839e1c26d98b3941ac0c2a3ac7667
parent7025f11d59e1a9cc9e2db8bc8f95337e1fe60dcd
usb: musb: fix remote wakeup racing with suspend

BugLink: http://bugs.launchpad.net/bugs/1794889
[ Upstream commit ebc3dd688cd988754a304147753b13e58de1b5a1 ]

It has been observed that writing 0xF2 to the power register while it
reads as 0xF4 results in the register having the value 0xF0, i.e. clearing
RESUME and setting SUSPENDM in one go does not work. It might also violate
the USB spec to transition directly from resume to suspend, especially
when not taking T_DRSMDN into account. But this is what happens when a
remote wakeup occurs between SetPortFeature USB_PORT_FEAT_SUSPEND on the
root hub and musb_bus_suspend being called.

This commit returns -EBUSY when musb_bus_suspend is called while remote
wakeup is signalled and thus avoids to reset the RESUME bit. Ignoring
this error when musb_port_suspend is called from musb_hub_control is ok.

Signed-off-by: Daniel Glöckner <dg@emlix.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/usb/musb/musb_host.c
drivers/usb/musb/musb_host.h
drivers/usb/musb/musb_virthub.c