1
0
Fork 0
remarkable-linux/drivers/phy
Arnd Bergmann 969e2145eb phy: work around 'phys' references to usb-nop-xceiv devices
commit b7563e2796 upstream.

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: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-23 19:57:07 +01:00
..
tegra phy: tegra: mark tegra_xusb_lane_lookup_function() static 2016-09-10 16:48:35 +05:30
Kconfig phy: qcom-usb-hs: Add depends on EXTCON 2017-05-14 14:00:19 +02:00
Makefile phy: Add USB Type-C PHY driver for rk3399 2016-09-10 16:49:01 +05:30
phy-armada375-usb2.c phy: Constify struct phy_ops variables 2015-08-03 18:35:09 +05:30
phy-bcm-cygnus-pcie.c phy: cygnus: pcie: add missing of_node_put 2015-12-03 12:28:23 +05:30
phy-bcm-kona-usb2.c phy: Constify struct phy_ops variables 2015-08-03 18:35:09 +05:30
phy-bcm-ns-usb2.c phy: bcm-ns-usb2: checking the wrong variable 2016-06-17 19:02:08 +05:30
phy-bcm-ns-usb3.c phy: bcm-ns-usb3: new driver for USB 3.0 PHY on Northstar 2016-09-10 16:48:28 +05:30
phy-bcm-ns2-pcie.c phy: bcm-ns2-pcie: Set missing .owner field in ns2_pci_phy_ops 2016-09-10 16:48:36 +05:30
phy-berlin-sata.c phy: berlin-sata: add missing of_node_put 2015-12-03 12:28:23 +05:30
phy-berlin-usb.c phy: berlin-usb: don't set device's driver_data 2015-12-20 17:43:12 +05:30
phy-brcm-sata.c phy: brcm-sata: Return proper error if brcm_sata_phy_init fails 2016-08-12 14:59:10 +05:30
phy-core.c phy: work around 'phys' references to usb-nop-xceiv devices 2018-01-23 19:57:07 +01:00
phy-da8xx-usb.c phy: da8xx-usb: rename the ohci device to ohci-da8xx 2016-11-05 13:45:02 +05:30
phy-dm816x-usb.c phy: dm816x: use __maybe_unused to hide pm functions 2016-03-03 20:37:41 -08:00
phy-exynos-dp-video.c phy: Constify struct phy_ops variables 2015-08-03 18:35:09 +05:30
phy-exynos-mipi-video.c phy: exynos-mipi-video: avoid uninitialized variable use 2016-05-30 18:21:37 +05:30
phy-exynos4x12-usb2.c
phy-exynos5-usbdrd.c phy: exynos5-usbdrd: Remove "static" from local variable 2016-09-10 16:48:25 +05:30
phy-exynos4210-usb2.c
phy-exynos5250-sata.c phy: Constify struct phy_ops variables 2015-08-03 18:35:09 +05:30
phy-exynos5250-usb2.c
phy-hi6220-usb.c phy: add phy-hi6220-usb 2015-12-20 15:21:38 +05:30
phy-hix5hd2-sata.c phy: Constify struct phy_ops variables 2015-08-03 18:35:09 +05:30
phy-lpc18xx-usb-otg.c phy: lpc18xx-usb-otg: fix clock order in phy init 2015-08-10 20:11:58 +05:30
phy-miphy28lp.c phy: miphy28lp: Inform the reset framework that our reset line may be shared 2016-07-01 10:51:30 +01:00
phy-miphy365x.c phy: miphy365x: add missing of_node_put 2015-12-03 12:28:23 +05:30
phy-mt65xx-usb3.c phy: phy-mt65xx-usb3: add support for mt2701 platform 2016-04-30 20:12:27 +05:30
phy-mvebu-sata.c phy: Constify struct phy_ops variables 2015-08-03 18:35:09 +05:30
phy-omap-control.c New Features 2015-04-10 13:47:50 +02:00
phy-omap-usb2.c phy: omap-usb2: support suspend/resume 2016-09-10 16:48:39 +05:30
phy-pistachio-usb.c PHY: Add driver for Pistachio USB2.0 PHY 2015-06-21 21:53:38 +02:00
phy-pxa-28nm-hsic.c phy: add Marvell HSIC 28nm PHY 2015-06-09 12:20:30 -07:00
phy-pxa-28nm-usb2.c phy: Add Marvell USB 2.0 OTG 28nm PHY 2015-06-09 12:20:30 -07:00
phy-qcom-apq8064-sata.c phy: Constify struct phy_ops variables 2015-08-03 18:35:09 +05:30
phy-qcom-ipq806x-sata.c phy: Constify struct phy_ops variables 2015-08-03 18:35:09 +05:30
phy-qcom-ufs-i.h phy: Constify struct phy_ops variables 2015-08-03 18:35:09 +05:30
phy-qcom-ufs-qmp-14nm.c phy: phy-qcom-ufs-qmp-14nm: Remove site specific OOM error message 2016-07-04 18:07:39 +05:30
phy-qcom-ufs-qmp-14nm.h
phy-qcom-ufs-qmp-20nm.c phy: phy-qcom-ufs-qmp-20nm: Remove site specific OOM error message 2016-07-04 18:07:39 +05:30
phy-qcom-ufs-qmp-20nm.h
phy-qcom-ufs.c phy: qcom-ufs: use of_property_read_bool 2016-09-10 16:48:29 +05:30
phy-rcar-gen2.c phy: rcar-gen2: add fallback binding 2016-04-29 14:40:07 +05:30
phy-rcar-gen3-usb2.c phy: rcar-gen3-usb2: Add a compatible string for r8a7796 2016-09-10 16:48:38 +05:30
phy-rockchip-dp.c phy: rockchip-dp: fix return value check in rockchip_dp_phy_probe() 2016-06-17 18:44:24 +05:30
phy-rockchip-emmc.c phy: rockchip-emmc: Wait even longer for the DLL to lock 2016-07-25 10:38:00 +02:00
phy-rockchip-inno-usb2.c phy: rockchip-inno-usb2: add a new driver for Rockchip usb2phy 2016-09-10 16:48:31 +05:30
phy-rockchip-pcie.c phy-rockchip-pcie: remove deassert of phy_rst from exit callback 2016-11-05 13:45:02 +05:30
phy-rockchip-typec.c phy: rockchip-typec: add pm runtime support 2016-09-10 17:13:29 +05:30
phy-rockchip-usb.c phy: rockchip-usb: use rockchip_usb_phy_reset to reset phy during wakeup 2016-09-10 17:31:40 +05:30
phy-s5pv210-usb2.c
phy-samsung-usb2.c phy: exynos-usb2: add vbus regulator support 2015-10-06 20:21:47 +05:30
phy-samsung-usb2.h phy: exynos-usb2: add vbus regulator support 2015-10-06 20:21:47 +05:30
phy-spear1310-miphy.c phy: Constify struct phy_ops variables 2015-08-03 18:35:09 +05:30
phy-spear1340-miphy.c phy: Constify struct phy_ops variables 2015-08-03 18:35:09 +05:30
phy-stih41x-usb.c phy: Constify struct phy_ops variables 2015-08-03 18:35:09 +05:30
phy-stih407-usb.c phy: phy-stih407-usb: Use explicit reset_control_get_exclusive() API 2016-07-01 10:52:09 +01:00
phy-sun4i-usb.c phy: sun4i: check PMU presence when poking unknown bit of pmu 2016-11-05 13:45:02 +05:30
phy-sun9i-usb.c phy: sun9i-usb: fix error handling 2016-08-12 14:59:10 +05:30
phy-ti-pipe3.c phy: ti-pipe3: Program the DPLL even if it was already locked 2016-06-03 12:06:41 +05:30
phy-tusb1210.c This is the bulk of GPIO changes for the v4.3 kernel cycle: 2015-09-04 10:07:45 -07:00
phy-twl4030-usb.c phy: twl4030-usb: Fix for musb session bit based PM 2016-11-17 16:25:40 +01:00
phy-xgene.c phy: xgene: rename "enum phy_mode" to "enum xgene_phy_mode" 2016-07-04 17:19:21 +05:30
ulpi_phy.h phy: ulpi_phy: Add const qualifier to ops 2015-08-03 18:35:09 +05:30