Skip to contentSkip to conversation

Revert "usb: dwc3: disable USB core PHY management"

PATCH In review Johan Hovold 3 participants 3 messages Nov 3, 2022 – Nov 4, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "usb: dwc3: disable USB core PHY management"

This reverts commit 6000b8d900cd5f52fbcd0776d0cc396e88c8c2ea.

The offending commit disabled the USB core PHY management as the dwc3 already manages the PHYs in question.

Unfortunately some platforms have started relying on having USB core also controlling the PHY and this is specifically currently needed on some Exynos platforms for PHY calibration or connected device may fail to enumerate.

The PHY calibration was previously handled in the dwc3 driver, but to work around some issues related to how the dwc3 driver interacts with xhci (e.g. using multiple drivers) this was moved to USB core by commits 34c7ed72f4f0 ("usb: core: phy: add support for PHY calibration") and a0a465569b45 ("usb: dwc3: remove generic PHY calibrate() calls").

The same PHY obviously should not be controlled from two different places, which for example do no agree on the PHY mode or power state during suspend, but as the offending patch was backported to stable, let's revert it for now.

Fixes 6000b8d900cd ("usb: dwc3: disable USB core PHY management")
---
 drivers/usb/dwc3/host.c | 10 ----------
 1 file changed, 10 deletions(-)
drivers/usb/dwc3/host.c +0 -10
index a7154fe8206d..f6f13e7f1ba1 100644
@@ -11,13 +11,8 @@
 #include <linux/of.h>
 #include <linux/platform_device.h>
 
-#include "../host/xhci-plat.h"
 #include "core.h"
 
-static const struct xhci_plat_priv dwc3_xhci_plat_priv = {
-	.quirks = XHCI_SKIP_PHY_INIT,
-};
-
 static void dwc3_host_fill_xhci_irq_res(struct dwc3 *dwc,
 					int irq, char *name)
 {
@@ -97,11 +92,6 @@ int dwc3_host_init(struct dwc3 *dwc)
 		goto err;
 	}
 
-	ret = platform_device_add_data(xhci, &dwc3_xhci_plat_priv,
-					sizeof(dwc3_xhci_plat_priv));
-	if (ret)
-		goto err;
-
 	memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props));
 
 	if (dwc->usb3_lpm_capable)
Signature · 1 line
2.37.3
Tested-by on v1 1/1
#1 lore raw
Quoted 21 lines · Johan Hovold

This reverts commit 6000b8d900cd5f52fbcd0776d0cc396e88c8c2ea.

The offending commit disabled the USB core PHY management as the dwc3 already manages the PHYs in question.

Unfortunately some platforms have started relying on having USB core also controlling the PHY and this is specifically currently needed on some Exynos platforms for PHY calibration or connected device may fail to enumerate.

The PHY calibration was previously handled in the dwc3 driver, but to work around some issues related to how the dwc3 driver interacts with xhci (e.g. using multiple drivers) this was moved to USB core by commits 34c7ed72f4f0 ("usb: core: phy: add support for PHY calibration") and a0a465569b45 ("usb: dwc3: remove generic PHY calibrate() calls").

The same PHY obviously should not be controlled from two different places, which for example do no agree on the PHY mode or power state during suspend, but as the offending patch was backported to stable, let's revert it for now.

Quoted 5 lines
Fixes 6000b8d900cd ("usb: dwc3: disable USB core PHY management")
Quoted 24 lines
---
  drivers/usb/dwc3/host.c | 10 ----------
  1 file changed, 10 deletions(-)
drivers/usb/dwc3/host.c +0 -5
index a7154fe8206d..f6f13e7f1ba1 100644
@@ -11,13 +11,8 @@
  #include <linux/of.h>
  #include <linux/platform_device.h>
 
-#include "../host/xhci-plat.h"
  #include "core.h"
 
-static const struct xhci_plat_priv dwc3_xhci_plat_priv = {
-	.quirks = XHCI_SKIP_PHY_INIT,
-};
-
  static void dwc3_host_fill_xhci_irq_res(struct dwc3 *dwc,
  					int irq, char *name)
  {
@@ -97,11 +92,6 @@ int dwc3_host_init(struct dwc3 *dwc)
  		goto err;

drivers/usb/dwc3/host.c int dwc3_host_init(struct dwc3 *dwc) · line 97

Quoted 10 lines
drivers/usb/dwc3/host.c +0 -5
  	}
 
-	ret = platform_device_add_data(xhci, &dwc3_xhci_plat_priv,
-					sizeof(dwc3_xhci_plat_priv));
-	if (ret)
-		goto err;
-
  	memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props));
 
  	if (dwc->usb3_lpm_capable)

Best regards

Signature · 2 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland
maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Johan Hovold
Quoted 21 lines · Johan Hovold

This reverts commit 6000b8d900cd5f52fbcd0776d0cc396e88c8c2ea.

The offending commit disabled the USB core PHY management as the dwc3 already manages the PHYs in question.

Unfortunately some platforms have started relying on having USB core also controlling the PHY and this is specifically currently needed on some Exynos platforms for PHY calibration or connected device may fail to enumerate.

The PHY calibration was previously handled in the dwc3 driver, but to work around some issues related to how the dwc3 driver interacts with xhci (e.g. using multiple drivers) this was moved to USB core by commits 34c7ed72f4f0 ("usb: core: phy: add support for PHY calibration") and a0a465569b45 ("usb: dwc3: remove generic PHY calibrate() calls").

The same PHY obviously should not be controlled from two different places, which for example do no agree on the PHY mode or power state during suspend, but as the offending patch was backported to stable, let's revert it for now.

Quoted 9 lines
---
 drivers/usb/dwc3/host.c | 10 ----------
 1 file changed, 10 deletions(-)

Thanks,
Thinh