]>
Commit | Line | Data |
---|---|---|
032fe8a0 GKH |
1 | From bd3486ded7a0c313a6575343e6c2b21d14476645 Mon Sep 17 00:00:00 2001 |
2 | From: Bin Liu <b-liu@ti.com> | |
3 | Date: Tue, 5 Dec 2017 08:45:30 -0600 | |
4 | Subject: usb: musb: da8xx: fix babble condition handling | |
5 | ||
6 | From: Bin Liu <b-liu@ti.com> | |
7 | ||
8 | commit bd3486ded7a0c313a6575343e6c2b21d14476645 upstream. | |
9 | ||
10 | When babble condition happens, the musb controller might automatically | |
11 | turns off VBUS. On DA8xx platform, the controller generates drvvbus | |
12 | interrupt for turning off VBUS along with the babble interrupt. | |
13 | ||
14 | In this case, we should handle the babble interrupt first and recover | |
15 | from the babble condition. | |
16 | ||
17 | This change ignores the drvvbus interrupt if babble interrupt is also | |
18 | generated at the same time, so the babble recovery routine works | |
19 | properly. | |
20 | ||
21 | Signed-off-by: Bin Liu <b-liu@ti.com> | |
22 | Signed-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; |