summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBin Liu <b-liu@ti.com>2017-12-05 08:45:30 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-20 10:05:00 +0100
commit5f2dbdff20e02e381e557bd9b6dd8111d3b89997 (patch)
treeb80b8343e82fd34a3a2b60eb2d2b11e99e447a7d
parent68d3bc40f5ca75c2927a9deaf887412976918bf9 (diff)
downloadlinux-stable-5f2dbdff20e02e381e557bd9b6dd8111d3b89997.tar.gz
linux-stable-5f2dbdff20e02e381e557bd9b6dd8111d3b89997.tar.bz2
linux-stable-5f2dbdff20e02e381e557bd9b6dd8111d3b89997.zip
usb: musb: da8xx: fix babble condition handling
commit bd3486ded7a0c313a6575343e6c2b21d14476645 upstream. When babble condition happens, the musb controller might automatically turns off VBUS. On DA8xx platform, the controller generates drvvbus interrupt for turning off VBUS along with the babble interrupt. In this case, we should handle the babble interrupt first and recover from the babble condition. This change ignores the drvvbus interrupt if babble interrupt is also generated at the same time, so the babble recovery routine works properly. Signed-off-by: Bin Liu <b-liu@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/musb/da8xx.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index 9a9c82a4d35d..d6a8e325950c 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -350,7 +350,15 @@ static irqreturn_t da8xx_musb_interrupt(int irq, void *hci)
musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE;
portstate(musb->port1_status |= USB_PORT_STAT_POWER);
del_timer(&otg_workaround);
- } else {
+ } else if (!(musb->int_usb & MUSB_INTR_BABBLE)){
+ /*
+ * When babble condition happens, drvvbus interrupt
+ * is also generated. Ignore this drvvbus interrupt
+ * and let babble interrupt handler recovers the
+ * controller; otherwise, the host-mode flag is lost
+ * due to the MUSB_DEV_MODE() call below and babble
+ * recovery logic will not called.
+ */
musb->is_active = 0;
MUSB_DEV_MODE(musb);
otg->default_a = 0;