* [2/2] usb: core: Try generic PHY_MODE_USB_HOST if usb_phy_roothub_set_mode fails
@ 2019-03-22 8:51 Chen-Yu Tsai
0 siblings, 0 replies; 2+ messages in thread
From: Chen-Yu Tsai @ 2019-03-22 8:51 UTC (permalink / raw)
To: Maxime Ripard, Greg Kroah-Hartman, Kishon Vijay Abraham I
Cc: Chen-Yu Tsai, Grygorii Strashko, linux-usb, linux-arm-kernel,
linux-kernel
From: Chen-Yu Tsai <wens@csie.org>
Some PHYs do not support PHY_MODE_USB_HOST_SS, i.e. USB 3.0 or higher.
Fall back and try the more generic PHY_MODE_USB_HOST if it fails.
Fixes: b97a31348379 ("usb: core: comply to PHY framework")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
drivers/usb/core/hcd.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 3189181bb628..975d7c1288e3 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -2741,6 +2741,9 @@ int usb_add_hcd(struct usb_hcd *hcd,
retval = usb_phy_roothub_set_mode(hcd->phy_roothub,
PHY_MODE_USB_HOST_SS);
+ if (retval)
+ retval = usb_phy_roothub_set_mode(hcd->phy_roothub,
+ PHY_MODE_USB_HOST);
if (retval)
goto err_usb_phy_roothub_power_on;
^ permalink raw reply related [flat|nested] 2+ messages in thread* [2/2] usb: core: Try generic PHY_MODE_USB_HOST if usb_phy_roothub_set_mode fails
@ 2019-03-22 12:56 Neil Armstrong
0 siblings, 0 replies; 2+ messages in thread
From: Neil Armstrong @ 2019-03-22 12:56 UTC (permalink / raw)
To: Chen-Yu Tsai, Maxime Ripard, Greg Kroah-Hartman,
Kishon Vijay Abraham I
Cc: Chen-Yu Tsai, Grygorii Strashko, linux-usb, linux-arm-kernel,
linux-kernel, open list:ARM/Amlogic Meson...
On 22/03/2019 09:51, Chen-Yu Tsai wrote:
> From: Chen-Yu Tsai <wens@csie.org>
>
> Some PHYs do not support PHY_MODE_USB_HOST_SS, i.e. USB 3.0 or higher.
> Fall back and try the more generic PHY_MODE_USB_HOST if it fails.
>
> Fixes: b97a31348379 ("usb: core: comply to PHY framework")
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
> drivers/usb/core/hcd.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
> index 3189181bb628..975d7c1288e3 100644
> --- a/drivers/usb/core/hcd.c
> +++ b/drivers/usb/core/hcd.c
> @@ -2741,6 +2741,9 @@ int usb_add_hcd(struct usb_hcd *hcd,
>
> retval = usb_phy_roothub_set_mode(hcd->phy_roothub,
> PHY_MODE_USB_HOST_SS);
> + if (retval)
> + retval = usb_phy_roothub_set_mode(hcd->phy_roothub,
> + PHY_MODE_USB_HOST);
> if (retval)
> goto err_usb_phy_roothub_power_on;
>
>
Tested-by: Neil Armstrong <narmstrong@baylibre.com>
This fixes USB on Amlogic GXL/GXL, tested on a Nexbox A1 with a S912 SoC running v5.1-rc1
Error was :
[ 4.851477] phy phy-d0078080.phy.3: unsupported PHY mode 5
[ 4.856266] xhci-hcd: probe of xhci-hcd.0.auto failed with error -22
Neil
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-03-22 12:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-22 8:51 [2/2] usb: core: Try generic PHY_MODE_USB_HOST if usb_phy_roothub_set_mode fails Chen-Yu Tsai
-- strict thread matches above, loose matches on Subject: below --
2019-03-22 12:56 Neil Armstrong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).