]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Oct 2017 08:39:10 +0000 (10:39 +0200)
commit180de9e37c6f759e5b041f070b08d4540cb97829
treed5107a2d290cf72f07e2d5ab8cf4e5b407eaf863
parent154af043a9902c5055e4253533dc2ee321a4fb11
usb: musb: Check for host-mode using is_host_active() on reset interrupt

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>
drivers/usb/musb/musb_core.c