Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: musb: Check devctl status again for a spurious session request

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>
Link: https://lore.kernel.org/r/20210518150615.53464-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Tony Lindgren and committed by
Greg Kroah-Hartman
7d076c2f 62d472d8

+9
+9
drivers/usb/musb/musb_core.c
··· 2055 2055 dev_err(musb->controller, "Could not enable: %i\n", 2056 2056 error); 2057 2057 musb->quirk_retries = 3; 2058 + 2059 + /* 2060 + * We can get a spurious MUSB_INTR_SESSREQ interrupt on start-up 2061 + * in B-peripheral mode with nothing connected and the session 2062 + * bit clears silently. Check status again in 3 seconds. 2063 + */ 2064 + if (devctl & MUSB_DEVCTL_BDEVICE) 2065 + schedule_delayed_work(&musb->irq_work, 2066 + msecs_to_jiffies(3000)); 2058 2067 } else { 2059 2068 musb_dbg(musb, "Allow PM with no session: %02x", devctl); 2060 2069 pm_runtime_mark_last_busy(musb->controller);