]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
Revert "usb: chipidea: move ci_ulpi_init after the phy initialization"
authorPeter Chen <peter.chen@kernel.org>
Fri, 17 May 2024 02:36:48 +0000 (10:36 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 4 Jun 2024 12:51:09 +0000 (14:51 +0200)
This reverts commit 22ffd399e6e7aa18ae0314278ed0b7f05f8ab679.
People report this commit causes the driver defer probed, and never
back to work[1][2].

[1] https://lore.kernel.org/lkml/20240407011913.GA168730@nchen-desktop/T/#mc2b93bc11a8b01ec7cd0d0bf6b0b03951d9ef751
[2] https://lore.kernel.org/lkml/20240407011913.GA168730@nchen-desktop/T/#me87d9a2a76c07619d83b3879ea14780da89fbbbf

Cc: Michael Grzeschik <m.grzeschik@pengutronix.de>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Wouter Franken <wouter@franken-peeters.be>
Signed-off-by: Peter Chen <peter.chen@kernel.org>
Link: https://lore.kernel.org/r/20240517023648.3459188-1-peter.chen@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/chipidea/core.c
drivers/usb/chipidea/ulpi.c

index bada13f704b62d51292a4de8d37c0f0d5b5d6706..835bf2428dc6eccee263b05024d42885884cd94d 100644 (file)
@@ -1084,6 +1084,10 @@ static int ci_hdrc_probe(struct platform_device *pdev)
                return -ENODEV;
        }
 
+       ret = ci_ulpi_init(ci);
+       if (ret)
+               return ret;
+
        if (ci->platdata->phy) {
                ci->phy = ci->platdata->phy;
        } else if (ci->platdata->usb_phy) {
@@ -1138,10 +1142,6 @@ static int ci_hdrc_probe(struct platform_device *pdev)
                goto ulpi_exit;
        }
 
-       ret = ci_ulpi_init(ci);
-       if (ret)
-               return ret;
-
        ci->hw_bank.phys = res->start;
 
        ci->irq = platform_get_irq(pdev, 0);
index 89fb51e2c3ded097441478c5fd9c3ac1d568b876..dfec07e8ae1d268c459b495603bd5e8de154518f 100644 (file)
@@ -68,6 +68,11 @@ int ci_ulpi_init(struct ci_hdrc *ci)
        if (ci->platdata->phy_mode != USBPHY_INTERFACE_MODE_ULPI)
                return 0;
 
+       /*
+        * Set PORTSC correctly so we can read/write ULPI registers for
+        * identification purposes
+        */
+       hw_phymode_configure(ci);
 
        ci->ulpi_ops.read = ci_ulpi_read;
        ci->ulpi_ops.write = ci_ulpi_write;