Skip to content

Commit 089a2d8

Browse files
liubiingregkh
authored andcommitted
usb: musb: only restore devctl when session was set in backup
commit 84ac5d1140f716a616522f952734e850448d2556 upstream. If the session bit was not set in the backup of devctl register, restoring devctl would clear the session bit. Therefor, only restore devctl register when the session bit was set in the backup. This solves the device enumeration failure in otg mode exposed by commit 56f487c (PM / Runtime: Update last_busy in rpm_resume). Signed-off-by: Bin Liu <b-liu@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4fe6d4b commit 089a2d8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/usb/musb/musb_core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2401,7 +2401,8 @@ static void musb_restore_context(struct musb *musb)
24012401
musb_writew(musb_base, MUSB_INTRTXE, musb->intrtxe);
24022402
musb_writew(musb_base, MUSB_INTRRXE, musb->intrrxe);
24032403
musb_writeb(musb_base, MUSB_INTRUSBE, musb->context.intrusbe);
2404-
musb_writeb(musb_base, MUSB_DEVCTL, musb->context.devctl);
2404+
if (musb->context.devctl & MUSB_DEVCTL_SESSION)
2405+
musb_writeb(musb_base, MUSB_DEVCTL, musb->context.devctl);
24052406

24062407
for (i = 0; i < musb->config->num_eps; ++i) {
24072408
struct musb_hw_ep *hw_ep;

0 commit comments

Comments
 (0)