Skip to content

Commit 08034d1

Browse files
pelwellpopcornmix
authored andcommitted
Revert "usb/dwc2: Set correct state on gadget disconnect"
This reverts commit c397485. See: #3885 Signed-off-by: Phil Elwell <[email protected]>
1 parent d9de3b5 commit 08034d1

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/usb/dwc2/core_intr.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,11 +533,14 @@ static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg)
533533
__func__);
534534
}
535535
skip_power_saving:
536-
/* Raspberry Pi seems to call the suspend interrupt on gadget disconnect, so instead of setting state to suspend set to not attached */
537-
538-
hsotg->lx_state = DWC2_L3;
536+
/*
537+
* Change to L2 (suspend) state before releasing
538+
* spinlock
539+
*/
540+
hsotg->lx_state = DWC2_L2;
539541

540-
usb_gadget_set_state(&hsotg->gadget, USB_STATE_NOTATTACHED);
542+
/* Call gadget suspend callback */
543+
call_gadget(hsotg, suspend);
541544
}
542545
} else {
543546
if (hsotg->op_state == OTG_STATE_A_PERIPHERAL) {

0 commit comments

Comments
 (0)