[PATCH 5/6] usb: host: ehci-msm: Drop redundant EHCI register writes

Stephan Gerhold stephan.gerhold at linaro.org
Mon Apr 7 11:54:25 CEST 2025


ehci_unregister() already clears the CMD_RUN bit with more careful checks.
It also ensures that we only do this in case we were actually in USB host
(rather than USB device) mode. It's not clear what the extra register
writes in the Qualcomm-specific ehci-msm driver are supposed to do, so just
drop them.

Signed-off-by: Stephan Gerhold <stephan.gerhold at linaro.org>
---
 drivers/usb/host/ehci-msm.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c
index 17cfff8380c3953900fe6383bee396b147287592..659a917ad27372f8f5c7138c40881b60413323e5 100644
--- a/drivers/usb/host/ehci-msm.c
+++ b/drivers/usb/host/ehci-msm.c
@@ -87,16 +87,12 @@ cleanup_clocks:
 static int ehci_usb_remove(struct udevice *dev)
 {
 	struct msm_ehci_priv *p = dev_get_priv(dev);
-	struct usb_ehci *ehci = p->ehci;
 	int ret;
 
 	ret = ehci_deregister(dev);
 	if (ret)
 		return ret;
 
-	/* Stop controller. */
-	clrbits_le32(&ehci->usbcmd, CMD_RUN);
-
 	ret = generic_shutdown_phy(&p->phy);
 	if (ret)
 		return ret;
@@ -105,15 +101,6 @@ static int ehci_usb_remove(struct udevice *dev)
 	if (ret < 0)
 		return ret;
 
-	/* Reset controller */
-	setbits_le32(&ehci->usbcmd, CMD_RESET);
-
-	/* Wait for reset */
-	if (wait_for_bit_le32(&ehci->usbcmd, CMD_RESET, false, 30, false)) {
-		printf("Stuck on USB reset.\n");
-		return -ETIMEDOUT;
-	}
-
 	clk_release_bulk(&p->clks);
 	return 0;
 }

-- 
2.47.2



More information about the U-Boot mailing list