From: Kishon Vijay Abraham I <kishon@ti.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Eric Anholt <eric@anholt.net>,
Florian Fainelli <f.fainelli@gmail.com>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Rob Herring <robh+dt@kernel.org>,
linux-usb@vger.kernel.org, stable@vger.kernel.org,
Stefan Wahren <stefan.wahren@i2se.com>,
Felipe Balbi <balbi@kernel.org>,
Andrzej Pietrasiewicz <andrzej.p@samsung.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] phy: work around 'phys' references to usb-phy devices
Date: Tue, 9 Jan 2018 00:02:54 +0530 [thread overview]
Message-ID: <aa02104b-d80d-8b12-4403-b5cedc23f03a@ti.com> (raw)
In-Reply-To: <20180108130116.80148-1-arnd@arndb.de>
Hi Arnd,
On Monday 08 January 2018 06:31 PM, Arnd Bergmann wrote:
> 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, usb_add_hcd() (along with the respective functions in dwc2 and
> dwc3) propagate the EPROBE_DEFER return code so we can try again whenever
> the driver gets loaded. In case the driver is written for the usb-phy
> subsystem (like usb-generic-phy aka usb-nop-xceiv), we will never load
> a generic-phy driver for it, and keep failing here.
>
> There is only a small number of remaining usb-phy drivers that support
> device tree, so this adds a workaround by providing a full list of the
> potentially affected drivers, and always failing the probe with -ENODEV
> here, which is the same behavior that we used to get with incorrect
> device tree files. 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).
> Reverting back to the DTS sources that work would in theory fix USB
> support for now, but in the long run we'd run into the same problem
> again when the drivers get ported from usb-phy to generic-phy.
>
> Fixes: 014d6da6cb25 ("ARM: dts: bcm283x: Fix DTC warnings about missing phy-cells")
> Link: https://marc.info/?l=linux-usb&m=151518314314753&w=2
> Cc: stable@vger.kernel.org
> Cc: Stefan Wahren <stefan.wahren@i2se.com>
> Cc: Felipe Balbi <balbi@kernel.org>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> This obviously needs to be tested, I wrote this up as a reply to
> Stefan's bug report. I'm fairly sure that I covered all usb-phy
> driver strings here. My goal is to have a fix merged into 4.15
> rather than reverting all the DT fixes.
Shouldn't the fix be in phy consumer drivers to not return error if it's able
to find the phy either using usb-phy or generic phy?
> ---
> drivers/phy/phy-core.c | 27 +++++++++++++++++++++++++++
> 1 file changed, 27 insertions(+)
>
> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> index b4964b067aec..bb4dd2a2de2d 100644
> --- a/drivers/phy/phy-core.c
> +++ b/drivers/phy/phy-core.c
> @@ -387,6 +387,24 @@ int phy_calibrate(struct phy *phy)
> }
> EXPORT_SYMBOL_GPL(phy_calibrate);
>
> +static struct of_device_id __maybe_unused legacy_usbphy[] = {
> + { .compatible = "fsl,imx23-usbphy" },
> + { .compatible = "fsl,imx6q-usbphy" },
> + { .compatible = "fsl,imx6sl-usbphy" },
> + { .compatible = "fsl,imx6sx-usbphy" },
> + { .compatible = "fsl,imx6ul-usbphy" },
> + { .compatible = "fsl,vf610-usbphy" },
> + { .compatible = "nvidia,tegra20-usb-phy" },
> + { .compatible = "nvidia,tegra30-usb-phy" },
> + { .compatible = "nxp,isp1301" },
> + { .compatible = "ti,am335x-usb-ctrl-module" },
> + { .compatible = "ti,am335x-usb-phy" },
> + { .compatible = "ti,keystone-usbphy" },
> + { .compatible = "ti,twl6030-usb" },
> + { .compatible = "usb-nop-xceiv" },
> + {},
"ti,am335x-usb-ctrl-module" and "ti,twl6030-usb" are not phys.
Thanks
Kishon
next prev parent reply other threads:[~2018-01-08 18:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-08 13:01 [PATCH] phy: work around 'phys' references to usb-phy devices Arnd Bergmann
2018-01-08 18:32 ` Kishon Vijay Abraham I [this message]
2018-01-10 20:57 ` Arnd Bergmann
[not found] ` <CAK8P3a0F4sK=ou8HXmSktq+0S22juYaCaY48RStDKwk8QGgviQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-11 13:30 ` Kishon Vijay Abraham I
[not found] ` <6dd37865-9c71-29f9-16b4-26e51e6b1c70-l0cyMroinI0@public.gmane.org>
2018-01-11 15:20 ` Arnd Bergmann
[not found] ` <CAK8P3a0NSGCR8=MzHAPqyhWMsUWAxJjtstYo8gszKcXUCaupgg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-11 18:16 ` Eric Anholt
[not found] ` <87d12guups.fsf-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org>
2018-01-12 6:00 ` Kishon Vijay Abraham I
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aa02104b-d80d-8b12-4403-b5cedc23f03a@ti.com \
--to=kishon@ti.com \
--cc=andrzej.p@samsung.com \
--cc=arnd@arndb.de \
--cc=balbi@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=eric@anholt.net \
--cc=f.fainelli@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=stable@vger.kernel.org \
--cc=stefan.wahren@i2se.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).