From: Chen-Yu Tsai Date: Fri, 22 Mar 2019 08:51:08 +0000 (+0800) Subject: usb: core: Try generic PHY_MODE_USB_HOST if usb_phy_roothub_set_mode fails X-Git-Tag: v5.4-rc1~1305^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e671765e521c571afec3157a7e17502d54f6a43e;p=platform%2Fkernel%2Flinux-rpi.git usb: core: Try generic PHY_MODE_USB_HOST if usb_phy_roothub_set_mode fails 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 Tested-by: Neil Armstrong Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 3189181..975d7c1 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -2742,6 +2742,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; retval = usb_phy_roothub_power_on(hcd->phy_roothub);