]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.9.71/usb-musb-da8xx-fix-babble-condition-handling.patch
Linux 4.19.31
[thirdparty/kernel/stable-queue.git] / releases / 4.9.71 / usb-musb-da8xx-fix-babble-condition-handling.patch
CommitLineData
032fe8a0
GKH
1From bd3486ded7a0c313a6575343e6c2b21d14476645 Mon Sep 17 00:00:00 2001
2From: Bin Liu <b-liu@ti.com>
3Date: Tue, 5 Dec 2017 08:45:30 -0600
4Subject: usb: musb: da8xx: fix babble condition handling
5
6From: Bin Liu <b-liu@ti.com>
7
8commit bd3486ded7a0c313a6575343e6c2b21d14476645 upstream.
9
10When babble condition happens, the musb controller might automatically
11turns off VBUS. On DA8xx platform, the controller generates drvvbus
12interrupt for turning off VBUS along with the babble interrupt.
13
14In this case, we should handle the babble interrupt first and recover
15from the babble condition.
16
17This change ignores the drvvbus interrupt if babble interrupt is also
18generated at the same time, so the babble recovery routine works
19properly.
20
21Signed-off-by: Bin Liu <b-liu@ti.com>
22Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23
24---
25 drivers/usb/musb/da8xx.c | 10 +++++++++-
26 1 file changed, 9 insertions(+), 1 deletion(-)
27
28--- a/drivers/usb/musb/da8xx.c
29+++ b/drivers/usb/musb/da8xx.c
30@@ -302,7 +302,15 @@ static irqreturn_t da8xx_musb_interrupt(
31 musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE;
32 portstate(musb->port1_status |= USB_PORT_STAT_POWER);
33 del_timer(&otg_workaround);
34- } else {
35+ } else if (!(musb->int_usb & MUSB_INTR_BABBLE)){
36+ /*
37+ * When babble condition happens, drvvbus interrupt
38+ * is also generated. Ignore this drvvbus interrupt
39+ * and let babble interrupt handler recovers the
40+ * controller; otherwise, the host-mode flag is lost
41+ * due to the MUSB_DEV_MODE() call below and babble
42+ * recovery logic will not called.
43+ */
44 musb->is_active = 0;
45 MUSB_DEV_MODE(musb);
46 otg->default_a = 0;