usb: host: ehci-msm: Drop redundant EHCI register writes
authorStephan Gerhold <stephan.gerhold@linaro.org>
Mon, 7 Apr 2025 09:54:25 +0000 (11:54 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 30 Oct 2025 17:04:51 +0000 (11:04 -0600)
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@linaro.org>
Acked-by: Caleb Connolly <caleb.connolly@linaro.org>
Tested-by: Sam Day <me@samcday.com>
Link: https://patch.msgid.link/20250407-ehci-msm-fixes-v1-5-f8b30eb05d07@linaro.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
drivers/usb/host/ehci-msm.c

index 17cfff8..659a917 100644 (file)
@@ -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;
 }