]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
usb: dwc3: keep susphy enabled during exit to avoid controller faults
authorUdipto Goswami <udipto.goswami@oss.qualcomm.com>
Tue, 30 Dec 2025 15:55:37 +0000 (10:55 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:10:07 +0000 (13:10 +0100)
[ Upstream commit e1003aa7ec9eccdde4c926bd64ef42816ad55f25 ]

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>
[ Adjust context ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/gadget.c
drivers/usb/dwc3/host.c

index de6406ada056c131704c67a6881251d2b485e4f3..9dbbefe00f220e544d11a28de64f2c8c2f232d6d 100644 (file)
@@ -4585,7 +4585,7 @@ void dwc3_gadget_exit(struct dwc3 *dwc)
        if (!dwc->gadget)
                return;
 
-       dwc3_enable_susphy(dwc, false);
+       dwc3_enable_susphy(dwc, true);
        usb_del_gadget(dwc->gadget);
        dwc3_gadget_free_endpoints(dwc);
        usb_put_gadget(dwc->gadget);
index 9adcf3a7e9782d7b7b84328f027e7fd33fcc3f68..c6514cd1ebd8e0972e69ffc58acb213849564ac5 100644 (file)
@@ -157,7 +157,7 @@ err:
 
 void dwc3_host_exit(struct dwc3 *dwc)
 {
-       dwc3_enable_susphy(dwc, false);
+       dwc3_enable_susphy(dwc, true);
        platform_device_unregister(dwc->xhci);
        dwc->xhci = NULL;
 }