On Mon, Mar 24, 2025 at 11:17:55AM +0800, Kuen-Han Tsai wrote:
When dwc3_gadget_soft_disconnect() fails, dwc3_suspend_common() keeps going with the suspend, resulting in a period where the power domain is off, but the gadget driver remains connected. Within this time frame, invoking vbus_event_work() will cause an error as it attempts to access DWC3 registers for endpoint disabling after the power domain has been completely shut down.
Abort the suspend sequence when dwc3_gadget_suspend() cannot halt the controller and proceeds with a soft connect.
Fixes: c8540870af4c ("usb: dwc3: gadget: Improve dwc3_gadget_suspend() and dwc3_gadget_resume()")
Please do not line-wrap this type of thing.
thanks,
greg k-h