Skip to content

Commit 54578ee

Browse files
liubiingregkh
authored andcommitted
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: ea2f35c ("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>
1 parent 6010abf commit 54578ee

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

drivers/usb/musb/musb_dsps.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,11 @@ static void dsps_musb_enable(struct musb *musb)
181181

182182
musb_writel(reg_base, wrp->epintr_set, epmask);
183183
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)
187189
dsps_mod_timer(glue, -1);
188190
}
189191

@@ -254,6 +256,10 @@ static int dsps_check_status(struct musb *musb, void *unused)
254256
musb->xceiv->otg->state = OTG_STATE_A_IDLE;
255257
MUSB_HST_MODE(musb);
256258
}
259+
260+
if (musb->port_mode == MUSB_PERIPHERAL)
261+
skip_session = 1;
262+
257263
if (!(devctl & MUSB_DEVCTL_SESSION) && !skip_session)
258264
musb_writeb(mregs, MUSB_DEVCTL,
259265
MUSB_DEVCTL_SESSION);

0 commit comments

Comments
 (0)