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

Configure Feed

Select the types of activity you want to include in your feed.

usb: musb: dsps: fix runtime pm for peripheral mode

Since the runtime PM support was added in musb, dsps relies on the timer
calling otg_timer() to activate the usb subsystem. However the driver
doesn't enable the timer for peripheral port, then the peripheral port is
unable to be enumerated by a host if the other usb port is disabled or in
peripheral mode too.

So let's start the timer for peripheral port too.

Fixes: ea2f35c01d5e ("usb: musb: Fix sleeping function called from invalid context for hdrc glue")
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Bin Liu and committed by
Greg Kroah-Hartman
54578ee8 6010abf2

+9 -3
+9 -3
drivers/usb/musb/musb_dsps.c
··· 181 181 182 182 musb_writel(reg_base, wrp->epintr_set, epmask); 183 183 musb_writel(reg_base, wrp->coreintr_set, coremask); 184 - /* start polling for ID change in dual-role idle mode */ 185 - if (musb->xceiv->otg->state == OTG_STATE_B_IDLE && 186 - musb->port_mode == MUSB_OTG) 184 + /* 185 + * start polling for runtime PM active and idle, 186 + * and for ID change in dual-role idle mode. 187 + */ 188 + if (musb->xceiv->otg->state == OTG_STATE_B_IDLE) 187 189 dsps_mod_timer(glue, -1); 188 190 } 189 191 ··· 256 254 musb->xceiv->otg->state = OTG_STATE_A_IDLE; 257 255 MUSB_HST_MODE(musb); 258 256 } 257 + 258 + if (musb->port_mode == MUSB_PERIPHERAL) 259 + skip_session = 1; 260 + 259 261 if (!(devctl & MUSB_DEVCTL_SESSION) && !skip_session) 260 262 musb_writeb(mregs, MUSB_DEVCTL, 261 263 MUSB_DEVCTL_SESSION);