Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: dwc3: keep susphy enabled during exit to avoid controller faults

On some platforms, switching USB roles from host to device can trigger
controller faults due to premature PHY power-down. This occurs when the
PHY is disabled too early during teardown, causing synchronization
issues between the PHY and controller.

Keep susphy enabled during dwc3_host_exit() and dwc3_gadget_exit()
ensures the PHY remains in a low-power state capable of handling
required commands during role switch.

Cc: stable <stable@kernel.org>
Fixes: 6d735722063a ("usb: dwc3: core: Prevent phy suspend during init")
Suggested-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Udipto Goswami <udipto.goswami@oss.qualcomm.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/20251126054221.120638-1-udipto.goswami@oss.qualcomm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Udipto Goswami and committed by
Greg Kroah-Hartman
e1003aa7 74098cc0

+2 -2
+1 -1
drivers/usb/dwc3/gadget.c
··· 4826 4826 if (!dwc->gadget) 4827 4827 return; 4828 4828 4829 - dwc3_enable_susphy(dwc, false); 4829 + dwc3_enable_susphy(dwc, true); 4830 4830 usb_del_gadget(dwc->gadget); 4831 4831 dwc3_gadget_free_endpoints(dwc); 4832 4832 usb_put_gadget(dwc->gadget);
+1 -1
drivers/usb/dwc3/host.c
··· 227 227 if (dwc->sys_wakeup) 228 228 device_init_wakeup(&dwc->xhci->dev, false); 229 229 230 - dwc3_enable_susphy(dwc, false); 230 + dwc3_enable_susphy(dwc, true); 231 231 platform_device_unregister(dwc->xhci); 232 232 dwc->xhci = NULL; 233 233 }