]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
usb: musb: Check for host-mode using is_host_active() on reset interrupt
authorJonathan Liu <net147@gmail.com>
Tue, 10 Oct 2017 03:46:12 +0000 (22:46 -0500)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Thu, 16 Nov 2017 13:23:12 +0000 (11:23 -0200)
commit41d239d3c2587cda8be77fa5c28b2682ffccf0bd
treee0f69a99c697d12c4c96efe4b0333a0121625bdb
parentc014ab1aa28ba5d85ac2321af03c25239a0aca6b
usb: musb: Check for host-mode using is_host_active() on reset interrupt

BugLink: http://bugs.launchpad.net/bugs/1731951
commit 445ef61543da3db5b699f87fb0aa4f227165f6ed upstream.

The sunxi musb has a bug where sometimes it will generate a babble
error on device disconnect instead of a disconnect IRQ. When this
happens the musb controller switches from host mode to device mode
(it clears MUSB_DEVCTL_HM/MUSB_DEVCTL_SESSION and sets
MUSB_DEVCTL_BDEVICE) and gets stuck in this state.

The babble error is misdetected as a bus reset because MUSB_DEVCTL_HM
was cleared.

To fix this, use is_host_active() rather than (devctl & MUSB_DEVCTL_HM)
to detect babble error so that sunxi musb babble recovery can handle it
by restoring the mode. This information is provided by the driver logic
and does not rely on register contents.

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/usb/musb/musb_core.c