Commit 2cd6e922 authored by Bin Liu's avatar Bin Liu Committed by Greg Kroah-Hartman

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

[ Upstream commit 54578ee8 ]

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: ea2f35c0 ("usb: musb: Fix sleeping function called from invalid context for hdrc glue")
Acked-by: 's avatarTony Lindgren <>
Signed-off-by: 's avatarBin Liu <>
Signed-off-by: 's avatarGreg Kroah-Hartman <>
Signed-off-by: 's avatarSasha Levin <>
parent 558321c9
......@@ -181,9 +181,11 @@ static void dsps_musb_enable(struct musb *musb)
musb_writel(reg_base, wrp->epintr_set, epmask);
musb_writel(reg_base, wrp->coreintr_set, coremask);
/* start polling for ID change in dual-role idle mode */
if (musb->xceiv->otg->state == OTG_STATE_B_IDLE &&
musb->port_mode == MUSB_OTG)
* start polling for runtime PM active and idle,
* and for ID change in dual-role idle mode.
if (musb->xceiv->otg->state == OTG_STATE_B_IDLE)
dsps_mod_timer(glue, -1);
......@@ -254,6 +256,10 @@ static int dsps_check_status(struct musb *musb, void *unused)
musb->xceiv->otg->state = OTG_STATE_A_IDLE;
if (musb->port_mode == MUSB_PERIPHERAL)
skip_session = 1;
if (!(devctl & MUSB_DEVCTL_SESSION) && !skip_session)
musb_writeb(mregs, MUSB_DEVCTL,
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment