FAILED: patch "[PATCH] usb: dwc3: fix PHY disable sequence" failed to apply to 5.10-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From d2ac7bef95c9ead307801ccb6cb6dfbeb14247bf Mon Sep 17 00:00:00 2001
From: Johan Hovold <[email protected]>
Date: Thu, 4 Aug 2022 17:09:53 +0200
Subject: [PATCH] usb: dwc3: fix PHY disable sequence
Generic PHYs must be powered-off before they can be tore down.
Similarly, suspending legacy PHYs after having powered them off makes no sense.
Fix the dwc3_core_exit() (e.g. called during suspend) and open-coded dwc3_probe() error-path sequences that got this wrong.
Note that this makes dwc3_core_exit() match the dwc3_core_init() error path with respect to powering off the PHYs.
drivers/usb/dwc3/core.c +10 -9
@@ -833,15 +833,16 @@ static void dwc3_core_exit(struct dwc3 *dwc) {dwc3_event_buffers_cleanup (dwc); +usb_phy_set_suspend (dwc->usb2_phy,1 ); +usb_phy_set_suspend (dwc->usb3_phy,1 ); +phy_power_off (dwc->usb2_generic_phy); +phy_power_off (dwc->usb3_generic_phy); +usb_phy_shutdown (dwc->usb2_phy);usb_phy_shutdown (dwc->usb3_phy);phy_exit (dwc->usb2_generic_phy);phy_exit (dwc->usb3_generic_phy); -usb_phy_set_suspend (dwc->usb2_phy,1 ); -usb_phy_set_suspend (dwc->usb3_phy,1 ); -phy_power_off (dwc->usb2_generic_phy); -phy_power_off (dwc->usb3_generic_phy);dwc3_clk_disable (dwc);reset_control_assert (dwc->reset); }
@@ -1879,16 +1880,16 @@ static int dwc3_probe(struct platform_device *pdev)dwc3_debugfs_exit (dwc);dwc3_event_buffers_cleanup (dwc); -usb_phy_shutdown (dwc->usb2_phy); -usb_phy_shutdown (dwc->usb3_phy); -phy_exit (dwc->usb2_generic_phy); -phy_exit (dwc->usb3_generic_phy); -usb_phy_set_suspend (dwc->usb2_phy,1 );usb_phy_set_suspend (dwc->usb3_phy,1 );phy_power_off (dwc->usb2_generic_phy);phy_power_off (dwc->usb3_generic_phy); +usb_phy_shutdown (dwc->usb2_phy); +usb_phy_shutdown (dwc->usb3_phy); +phy_exit (dwc->usb2_generic_phy); +phy_exit (dwc->usb3_generic_phy); +dwc3_ulpi_exit (dwc); err4: