linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: musb: Check devctl status again for a spurious session request
@ 2021-05-18 15:06 Tony Lindgren
  2021-05-27 19:15 ` Andreas Kemnade
  0 siblings, 1 reply; 16+ messages in thread
From: Tony Lindgren @ 2021-05-18 15:06 UTC (permalink / raw)
  To: Bin Liu, Greg Kroah-Hartman; +Cc: linux-usb, linux-omap

On start-up, we can get a spurious session request interrupt with nothing
connected. After that the devctl session bit will silently clear, but the
musb hardware is never idled until a cable is plugged in, or the glue
layer module is reloaded.

Let's just check the session bit again in 3 seconds in peripheral mode
to catch the issue.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/usb/musb/musb_core.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2055,6 +2055,15 @@ static void musb_pm_runtime_check_session(struct musb *musb)
 			dev_err(musb->controller, "Could not enable: %i\n",
 				error);
 		musb->quirk_retries = 3;
+
+		/*
+		 * We can get a spurious MUSB_INTR_SESSREQ interrupt on start-up
+		 * in B-peripheral mode with nothing connected and the session
+		 * bit clears silently. Check status again in 3 seconds.
+		 */
+		if (devctl & MUSB_DEVCTL_BDEVICE)
+			schedule_delayed_work(&musb->irq_work,
+					      msecs_to_jiffies(3000));
 	} else {
 		musb_dbg(musb, "Allow PM with no session: %02x", devctl);
 		pm_runtime_mark_last_busy(musb->controller);
-- 
2.31.1

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

end of thread, other threads:[~2021-06-06  6:01 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 15:06 [PATCH] usb: musb: Check devctl status again for a spurious session request Tony Lindgren
2021-05-27 19:15 ` Andreas Kemnade
2021-05-28  5:57   ` Tony Lindgren
2021-05-28  9:37     ` Andreas Kemnade
2021-06-02  5:41       ` Tony Lindgren
2021-06-03 21:22         ` Andreas Kemnade
2021-06-04  8:35     ` Andreas Kemnade
2021-06-04  9:39       ` Tony Lindgren
2021-06-04  9:59         ` Andreas Kemnade
2021-06-04 10:08           ` Tony Lindgren
2021-06-04 10:20             ` Andreas Kemnade
2021-06-04 14:45         ` Andreas Kemnade
2021-06-04 16:59         ` Andreas Kemnade
2021-06-05  5:18           ` Tony Lindgren
2021-06-05 14:20             ` Andreas Kemnade
2021-06-06  6:01               ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).