Revert "usb/dwc2: Set correct state on gadget disconnect"

This reverts commit c3974850cc.

See: https://github.com/raspberrypi/linux/issues/3885

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
This commit is contained in:
Phil Elwell
2020-10-06 11:44:16 +01:00
committed by popcornmix
parent 04b6be362a
commit 1fc4a597fd

View File

@@ -533,11 +533,14 @@ static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg)
__func__);
}
skip_power_saving:
/* Raspberry Pi seems to call the suspend interrupt on gadget disconnect, so instead of setting state to suspend set to not attached */
/*
* Change to L2 (suspend) state before releasing
* spinlock
*/
hsotg->lx_state = DWC2_L2;
hsotg->lx_state = DWC2_L3;
usb_gadget_set_state(&hsotg->gadget, USB_STATE_NOTATTACHED);
/* Call gadget suspend callback */
call_gadget(hsotg, suspend);
}
} else {
if (hsotg->op_state == OTG_STATE_A_PERIPHERAL) {