linux-stable/drivers/usb
Pali Rohár 3241929b67 usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720
Older ATF does not provide SMC call for USB 3.0 phy power on functionality
and therefore initialization of xhci-hcd is failing when older version of
ATF is used. In this case phy_power_on() function returns -EOPNOTSUPP.

[    3.108467] mvebu-a3700-comphy d0018300.phy: unsupported SMC call, try updating your firmware
[    3.117250] phy phy-d0018300.phy.0: phy poweron failed --> -95
[    3.123465] xhci-hcd: probe of d0058000.usb failed with error -95

This patch introduces a new plat_setup callback for xhci platform drivers
which is called prior calling usb_add_hcd() function. This function at its
beginning skips PHY init if hcd->skip_phy_initialization is set.

Current init_quirk callback for xhci platform drivers is called from
xhci_plat_setup() function which is called after chip reset completes.
It happens in the middle of the usb_add_hcd() function and therefore this
callback cannot be used for setting if PHY init should be skipped or not.

For Armada 3720 this patch introduce a new xhci_mvebu_a3700_plat_setup()
function configured as a xhci platform plat_setup callback. This new
function calls phy_power_on() and in case it returns -EOPNOTSUPP then
XHCI_SKIP_PHY_INIT quirk is set to instruct xhci-plat to skip PHY
initialization.

This patch fixes above failure by ignoring 'not supported' error in
xhci-hcd driver. In this case it is expected that phy is already power on.

It fixes initialization of xhci-hcd on Espressobin boards where is older
Marvell's Arm Trusted Firmware without SMC call for USB 3.0 phy power.

This is regression introduced in commit bd3d25b073 ("arm64: dts: marvell:
armada-37xx: link USB hosts with their PHYs") where USB 3.0 phy was defined
and therefore xhci-hcd on Espressobin with older ATF started failing.

Fixes: bd3d25b073 ("arm64: dts: marvell: armada-37xx: link USB hosts with their PHYs")
Cc: <stable@vger.kernel.org> # 5.1+: ea17a0f153: phy: marvell: comphy: Convert internal SMCC firmware return codes to errno
Cc: <stable@vger.kernel.org> # 5.1+: f768e71891: usb: host: xhci-plat: add priv quirk for skip PHY initialization
Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> # On R-Car
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> # xhci-plat
Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Pali Rohár <pali@kernel.org>
Link: https://lore.kernel.org/r/20210201150803.7305-1-pali@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-03 11:26:47 +01:00
..
atm drivers: usb: atm: use pr_err() and pr_warn() instead of raw printk() 2020-12-09 15:22:51 +01:00
c67x00 Linux 5.9-rc3 2020-08-31 07:11:45 +02:00
cdns3 usb: cdns3: imx: improve driver .remove API 2020-12-29 13:39:53 +08:00
chipidea usb: chipidea: ci_hdrc_imx: add missing put_device() call in usbmisc_get_init_data() 2020-12-28 15:45:53 +01:00
class USB: usblp: don't call usb_set_interface if there's a single alt 2021-01-26 15:15:31 +01:00
common usb: common: ulpi: Constify static attribute_group struct 2020-11-26 13:40:43 +01:00
core kcov, usb: hide in_serving_softirq checks in __usb_hcd_giveback_urb 2021-01-07 14:17:29 +01:00
dwc2 usb: dwc2: Avoid leaving the error_debugfs label unused 2020-10-27 11:33:53 +02:00
dwc3 usb: dwc3: gadget: Clear wait flag on dequeue 2021-01-07 14:24:35 +01:00
early usb: early: ehci-dbgp: convert to readl_poll_timeout_atomic() 2020-09-25 16:29:09 +02:00
gadget USB: gadget: legacy: fix an error code in eth_bind() 2021-01-31 13:53:39 +01:00
host usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720 2021-02-03 11:26:47 +01:00
image USB: microtek: use set_host_byte() 2020-09-16 12:42:10 +02:00
isp1760 usb: isp1760-hcd: convert to readl_poll_timeout_atomic() 2020-09-25 16:30:05 +02:00
misc USB: yurex: fix control-URB timeout handling 2020-12-28 15:47:06 +01:00
mon
mtu3 usb: mtu3: fix memory corruption in mtu3_debugfs_regset() 2020-12-07 15:26:18 +01:00
musb usb: Fix fall-through warnings for Clang 2020-11-23 17:46:01 +01:00
phy Char / Misc driver updates for 5.11-rc1 2020-12-15 14:10:09 -08:00
renesas_usbhs usb: renesas_usbhs: Clear pipe running flag in usbhs_pkt_pop() 2021-02-01 14:09:46 +01:00
roles device connection: Remove struct device_connection 2020-09-07 11:14:09 +02:00
serial USB: serial: option: Adding support for Cinterion MV31 2021-01-28 08:44:05 +01:00
storage usb: uas: Add PNY USB Portable SSD to unusual_uas 2021-01-05 14:05:10 +01:00
typec usb: typec: Send uevent for num_altmodes update 2021-01-07 14:22:22 +01:00
usbip usb: usbip: vhci_hcd: protect shift size 2021-01-04 16:52:40 +01:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile usb: host: imx21-hcd: Remove the driver 2020-11-13 15:22:46 +01:00
usb-skeleton.c