linux/drivers/phy
Arnd Bergmann b7563e2796 phy: work around 'phys' references to usb-nop-xceiv devices
Stefan Wahren reports a problem with a warning fix that was merged
for v4.15: we had lots of device nodes with a 'phys' property pointing
to a device node that is not compliant with the binding documented in
Documentation/devicetree/bindings/phy/phy-bindings.txt

This generally works because USB HCD drivers that support both the generic
phy subsystem and the older usb-phy subsystem ignore most errors from
phy_get() and related calls and then use the usb-phy driver instead.

However, it turns out that making the usb-nop-xceiv device compatible with
the generic-phy binding changes the phy_get() return code from -EINVAL to
-EPROBE_DEFER, and the dwc2 usb controller driver for bcm2835 now returns
-EPROBE_DEFER from its probe function rather than ignoring the failure,
breaking all USB support on raspberry-pi when CONFIG_GENERIC_PHY is
enabled. The same code is used in the dwc3 driver and the usb_add_hcd()
function, so a reasonable assumption would be that many other platforms
are affected as well.

I have reviewed all the related patches and concluded that "usb-nop-xceiv"
is the only USB phy that is affected by the change, and since it is by far
the most commonly referenced phy, all the other USB phy drivers appear
to be used in ways that are are either safe in DT (they don't use the
'phys' property), or in the driver (they already ignore -EPROBE_DEFER
from generic-phy when usb-phy is available).

To work around the problem, this adds a special case to _of_phy_get()
so we ignore any PHY node that is compatible with "usb-nop-xceiv",
as we know that this can never load no matter how much we defer. In the
future, we might implement a generic-phy driver for "usb-nop-xceiv"
and then remove this workaround.

Since we generally want older kernels to also want to work with the
fixed devicetree files, it would be good to backport the patch into
stable kernels as well (3.13+ are possibly affected), even though they
don't contain any of the patches that may have caused regressions.

Fixes: 014d6da6cb ARM: dts: bcm283x: Fix DTC warnings about missing phy-cells
Fixes: c5bbf358b7 arm: dts: nspire: Add missing #phy-cells to usb-nop-xceiv
Fixes: 44e5dced2e arm: dts: marvell: Add missing #phy-cells to usb-nop-xceiv
Fixes: f568f6f554 ARM: dts: omap: Add missing #phy-cells to usb-nop-xceiv
Fixes: d745d5f277 ARM: dts: imx51-zii-rdu1: Add missing #phy-cells to usb-nop-xceiv
Fixes: 915fbe59cb ARM: dts: imx: Add missing #phy-cells to usb-nop-xceiv
Link: https://marc.info/?l=linux-usb&m=151518314314753&w=2
Link: https://patchwork.kernel.org/patch/10158145/
Cc: stable@vger.kernel.org
Cc: Felipe Balbi <balbi@kernel.org>
Cc: Eric Anholt <eric@anholt.net>
Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Acked-by: Rob Herring <robh@kernel.org>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2018-01-19 16:12:37 +01:00
..
allwinner Update extcon for 4.15 2017-10-27 12:36:06 +02:00
amlogic phy: meson8b-usb2: add support for the USB PHY on Meson8 SoCs 2017-06-06 14:50:14 +05:30
broadcom USB/PHY patches for 4.15-rc1 2017-11-13 21:14:07 -08:00
hisilicon phy: Group vendor specific phy drivers 2017-06-01 15:28:33 +05:30
lantiq phy: Add an USB PHY driver for the Lantiq SoCs using the RCU module 2017-09-04 21:19:02 +02:00
marvell USB/PHY patches for 4.15-rc1 2017-11-13 21:14:07 -08:00
mediatek phy: phy-mtk-tphy: add set_mode callback 2017-10-23 11:19:25 +05:30
motorola phy: cpcap-usb: Fix platform_get_irq_byname's error checking. 2017-12-15 16:00:39 +05:30
qualcomm USB/PHY patches for 4.15-rc1 2017-11-13 21:14:07 -08:00
ralink phy: ralink: fix 64-bit build warning 2017-08-24 17:26:50 -07:00
renesas phy: rcar-gen3-usb2: select USB_COMMON 2017-12-15 16:00:41 +05:30
rockchip phy: rockchip-typec: add pm_runtime_disable in err case 2017-12-15 16:00:40 +05:30
samsung License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
st phy: Group vendor specific phy drivers 2017-06-01 15:28:33 +05:30
tegra phy: tegra: fix device-tree node lookups 2017-12-15 16:00:38 +05:30
ti USB/PHY patches for 4.15-rc1 2017-11-13 21:14:07 -08:00
Kconfig Merge branch '4.14-features' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2017-09-15 20:43:33 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
phy-core.c phy: work around 'phys' references to usb-nop-xceiv devices 2018-01-19 16:12:37 +01:00
phy-lpc18xx-usb-otg.c phy: lpc18xx-usb-otg: fix clock order in phy init 2015-08-10 20:11:58 +05:30
phy-pistachio-usb.c PHY: Add driver for Pistachio USB2.0 PHY 2015-06-21 21:53:38 +02:00
phy-xgene.c phy: xgene: rename "enum phy_mode" to "enum xgene_phy_mode" 2016-07-04 17:19:21 +05:30