]> asedeno.scripts.mit.edu Git - linux.git/commit
musb: sunxi: Force session end on babble errors in host-mode
authorHans de Goede <hdegoede@redhat.com>
Mon, 21 Nov 2016 14:59:23 +0000 (08:59 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Nov 2016 16:35:36 +0000 (17:35 +0100)
commit454f83d5e60110a18f24ffc0d58d2252d09c9a92
tree7a2bf961047f1666872fc7f9ce718fb99802f19b
parentd24b63abf4bc866ead04660b5265af77ac910abb
musb: sunxi: Force session end on babble errors in host-mode

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_SESSION and sets MUSB_DEVCTL_BDEVICE) and
gets stuck in this state.

Clearing this requires reporting Vbus low for 200 or more ms, but
on some devices Vbus is simply always high (host-only mode, no Vbus
control).

This commit adds a sunxi_musb_recover() callback which makes
sunxi_musb_work call phy_set_mode with the current mode, which
will force end the current session.

This fixes the musb controller getting stuck in this state on systems
without Vbus control; and also fixes the need to unplug the usb-b ->
usb-a cable to get out of this state on systems with Vbus control.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/musb/sunxi.c