All of lore.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] usb: musb: da8xx: fix babble condition handling" failed to apply to 4.14-stable tree
@ 2017-12-18 11:41 gregkh
  2017-12-18 14:44 ` [PATCH] usb: musb: da8xx: fix babble condition handling Bin Liu
  0 siblings, 1 reply; 4+ messages in thread
From: gregkh @ 2017-12-18 11:41 UTC (permalink / raw)
  To: b-liu, gregkh; +Cc: stable


The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

>From bd3486ded7a0c313a6575343e6c2b21d14476645 Mon Sep 17 00:00:00 2001
From: Bin Liu <b-liu@ti.com>
Date: Tue, 5 Dec 2017 08:45:30 -0600
Subject: [PATCH] usb: musb: da8xx: fix babble condition handling

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.

Cc: stable@vger.kernel.org # v3.16+
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index 0397606a211b..6c036de63272 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -284,7 +284,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(&musb->dev_timer);
-		} 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 be called.
+			 */
 			musb->is_active = 0;
 			MUSB_DEV_MODE(musb);
 			otg->default_a = 0;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] usb: musb: da8xx: fix babble condition handling
  2017-12-18 11:41 FAILED: patch "[PATCH] usb: musb: da8xx: fix babble condition handling" failed to apply to 4.14-stable tree gregkh
@ 2017-12-18 14:44 ` Bin Liu
  2017-12-18 15:16   ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Bin Liu @ 2017-12-18 14:44 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, Bin Liu

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, so the babble recovery routine works properly.

c: stable@vger.kernel.org # v3.16+
Signed-off-by: Bin Liu <b-liu@ti.com>
---
 drivers/usb/musb/da8xx.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index 0032441d68dd..ca8151f667c6 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -306,7 +306,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;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: musb: da8xx: fix babble condition handling
  2017-12-18 14:44 ` [PATCH] usb: musb: da8xx: fix babble condition handling Bin Liu
@ 2017-12-18 15:16   ` Greg Kroah-Hartman
  2017-12-18 15:26     ` Bin Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2017-12-18 15:16 UTC (permalink / raw)
  To: Bin Liu; +Cc: stable

On Mon, Dec 18, 2017 at 08:44:54AM -0600, Bin Liu wrote:
> 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, so the babble recovery routine works properly.
> 
> c: stable@vger.kernel.org # v3.16+
> Signed-off-by: Bin Liu <b-liu@ti.com>
> ---
>  drivers/usb/musb/da8xx.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)

Next time, please give me a hint that this was commit
bd3486ded7a0c313a6575343e6c2b21d14476645 in Linus's tree so I don't have
to dig it out :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: musb: da8xx: fix babble condition handling
  2017-12-18 15:16   ` Greg Kroah-Hartman
@ 2017-12-18 15:26     ` Bin Liu
  0 siblings, 0 replies; 4+ messages in thread
From: Bin Liu @ 2017-12-18 15:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: stable

On Mon, Dec 18, 2017 at 04:16:33PM +0100, Greg Kroah-Hartman wrote:
> On Mon, Dec 18, 2017 at 08:44:54AM -0600, Bin Liu wrote:
> > 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, so the babble recovery routine works properly.
> > 
> > c: stable@vger.kernel.org # v3.16+
> > Signed-off-by: Bin Liu <b-liu@ti.com>
> > ---
> >  drivers/usb/musb/da8xx.c | 10 +++++++++-
> >  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> Next time, please give me a hint that this was commit
> bd3486ded7a0c313a6575343e6c2b21d14476645 in Linus's tree so I don't have
> to dig it out :)

I am sorry. I should have checked the format of backport patches first.

Regards,
-Bin.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-12-18 15:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-18 11:41 FAILED: patch "[PATCH] usb: musb: da8xx: fix babble condition handling" failed to apply to 4.14-stable tree gregkh
2017-12-18 14:44 ` [PATCH] usb: musb: da8xx: fix babble condition handling Bin Liu
2017-12-18 15:16   ` Greg Kroah-Hartman
2017-12-18 15:26     ` Bin Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.