All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "usb: dwc3: disable USB core PHY management"
@ 2022-11-03 14:46 ` Johan Hovold
  2022-11-03 15:19   ` Marek Szyprowski
  2022-11-04  1:24   ` Thinh Nguyen
  0 siblings, 2 replies; 3+ messages in thread
From: Johan Hovold @ 2022-11-03 14:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Thinh Nguyen
  Cc: Marek Szyprowski, linux-usb, linux-kernel, Johan Hovold,
	Stefan Agner, stable

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.

Reported-by: Stefan Agner <stefan@agner.ch>
Link: https://lore.kernel.org/lkml/808bdba846bb60456adf10a3016911ee@agner.ch/
Fixes: 6000b8d900cd ("usb: dwc3: disable USB core PHY management")
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
 drivers/usb/dwc3/host.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index a7154fe8206d..f6f13e7f1ba1 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -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)
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Revert "usb: dwc3: disable USB core PHY management"
  2022-11-03 14:46 ` [PATCH] Revert "usb: dwc3: disable USB core PHY management" Johan Hovold
@ 2022-11-03 15:19   ` Marek Szyprowski
  2022-11-04  1:24   ` Thinh Nguyen
  1 sibling, 0 replies; 3+ messages in thread
From: Marek Szyprowski @ 2022-11-03 15:19 UTC (permalink / raw)
  To: Johan Hovold, Greg Kroah-Hartman, Thinh Nguyen
  Cc: linux-usb, linux-kernel, Stefan Agner, stable

On 03.11.2022 15:46, Johan Hovold wrote:
> 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.
>
> Reported-by: Stefan Agner <stefan@agner.ch>
> Link: https://lore.kernel.org/lkml/808bdba846bb60456adf10a3016911ee@agner.ch/
> Fixes: 6000b8d900cd ("usb: dwc3: disable USB core PHY management")
> Cc: stable@vger.kernel.org
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>   drivers/usb/dwc3/host.c | 10 ----------
>   1 file changed, 10 deletions(-)
>
> diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
> index a7154fe8206d..f6f13e7f1ba1 100644
> --- a/drivers/usb/dwc3/host.c
> +++ b/drivers/usb/dwc3/host.c
> @@ -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)

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Revert "usb: dwc3: disable USB core PHY management"
  2022-11-03 14:46 ` [PATCH] Revert "usb: dwc3: disable USB core PHY management" Johan Hovold
  2022-11-03 15:19   ` Marek Szyprowski
@ 2022-11-04  1:24   ` Thinh Nguyen
  1 sibling, 0 replies; 3+ messages in thread
From: Thinh Nguyen @ 2022-11-04  1:24 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Greg Kroah-Hartman, Thinh Nguyen, Marek Szyprowski, linux-usb,
	linux-kernel, Stefan Agner, stable

On Thu, Nov 03, 2022, Johan Hovold wrote:
> 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.
> 
> Reported-by: Stefan Agner <stefan@agner.ch>
> Link: https://urldefense.com/v3/__https://lore.kernel.org/lkml/808bdba846bb60456adf10a3016911ee@agner.ch/__;!!A4F2R9G_pg!alHoICKQIGg3RelD-tXOswfNBGy3QtLU4e9jazfXshXj1WeYF8LMgybbqHDrfszazJ9ywa1BdVX0i8gewLUmrvz2_mxX$ 
> Fixes: 6000b8d900cd ("usb: dwc3: disable USB core PHY management")
> Cc: stable@vger.kernel.org
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
> ---
>  drivers/usb/dwc3/host.c | 10 ----------
>  1 file changed, 10 deletions(-)
> 

Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

Thanks,
Thinh

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-04  1:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20221103144724eucas1p2a1b7c96e013cb32ae24f4bb8b353771d@eucas1p2.samsung.com>
2022-11-03 14:46 ` [PATCH] Revert "usb: dwc3: disable USB core PHY management" Johan Hovold
2022-11-03 15:19   ` Marek Szyprowski
2022-11-04  1:24   ` Thinh Nguyen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.