Skip to contentSkip to conversation

usb: musb: start session in resume for host port

PATCH New Bin Liu 1 participant 1 message May 13, 2020

Subsystems (2)
lore
Share & tools
lore

Bin Liu

author maintainer
#0 lore raw

PATCH 1/1 usb: musb: start session in resume for host port

Commit 17539f2f4f0b ("usb: musb: fix enumeration after resume") replaced musb_start() in musb_resume() to not override softconnect bit, but it doesn't restart the session for host port which was done in musb_start(). The session could be disabled in musb_suspend(), which leads the host port doesn't stay in host mode.

So let's start the session specifically for host port in musb_resume().

Fixes 17539f2f4f0b ("usb: musb: fix enumeration after resume")
---
 drivers/usb/musb/musb_core.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/usb/musb/musb_core.c +7 -0
index d590110539ab..48178aeccf5b 100644
@@ -2877,6 +2877,13 @@ static int musb_resume(struct device *dev)
 	musb_enable_interrupts(musb);
 	musb_platform_enable(musb);
 
+	/* session might be disabled in suspend */
+	if (musb->port_mode == MUSB_HOST &&
+	    !(musb->ops->quirks & MUSB_PRESERVE_SESSION)) {
+		devctl |= MUSB_DEVCTL_SESSION;
+		musb_writeb(musb->mregs, MUSB_DEVCTL, devctl);
+	}
+
 	spin_lock_irqsave(&musb->lock, flags);
 	error = musb_run_resume_work(musb);
 	if (error)
Signature · 1 line
2.17.1