From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Roger Quadros <rogerq@ti.com>, gregkh@linuxfoundation.org
Cc: linux-usb@vger.kernel.org, Alan Stern <stern@rowland.harvard.edu>,
Johan Hovold <johan@kernel.org>,
Ladislav Michl <ladis@linux-mips.org>,
Tony Lindgren <tony@atomide.com>
Subject: [v3] usb: ehci-omap: Fix deferred probe for phy handling
Date: Fri, 14 Dec 2018 11:49:44 +0200 [thread overview]
Message-ID: <57737009-775d-cef8-e31e-8885da4a3623@ti.com> (raw)
Roger,
On 14/12/2018 11.36, Roger Quadros wrote:
> PHY model is being used on omap5 platforms even if port mode
> is not OMAP_EHCI_PORT_MODE_PHY. So don't guess if PHY is required
> or not based on PHY mode.
>
> If PHY is provided in device tree, it must be required. So, if
> devm_usb_get_phy_by_phandle() gives us an error code other
> than -ENODEV (no PHY) then error out.
>
> This fixes USB Ethernet on omap5-uevm if PHY happens to
> probe after EHCI thus causing a -EPROBE_DEFER.
Thanks, it works.
Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> Cc: Alan Stern <stern@rowland.harvard.edu>
> Cc: Johan Hovold <johan@kernel.org>
> Cc: Ladislav Michl <ladis@linux-mips.org>
> Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
> Cc: Tony Lindgren <tony@atomide.com>
> Reported-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> Signed-off-by: Roger Quadros <rogerq@ti.com>
> ---
> drivers/usb/host/ehci-omap.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
> index 7e4c1334..7d20296 100644
> --- a/drivers/usb/host/ehci-omap.c
> +++ b/drivers/usb/host/ehci-omap.c
> @@ -159,11 +159,12 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
> /* get the PHY device */
> phy = devm_usb_get_phy_by_phandle(dev, "phys", i);
> if (IS_ERR(phy)) {
> - /* Don't bail out if PHY is not absolutely necessary */
> - if (pdata->port_mode[i] != OMAP_EHCI_PORT_MODE_PHY)
> + ret = PTR_ERR(phy);
> + if (ret == -ENODEV) { /* no PHY */
> + phy = NULL;
> continue;
> + }
>
> - ret = PTR_ERR(phy);
> if (ret != -EPROBE_DEFER)
> dev_err(dev, "Can't get PHY for port %d: %d\n",
> i, ret);
>
- Péter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
next reply other threads:[~2018-12-14 9:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-14 9:49 Peter Ujfalusi [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-12-14 15:06 [v3] usb: ehci-omap: Fix deferred probe for phy handling Alan Stern
2018-12-14 14:09 Tony Lindgren
2018-12-14 9:36 Roger Quadros
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=57737009-775d-cef8-e31e-8885da4a3623@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=johan@kernel.org \
--cc=ladis@linux-mips.org \
--cc=linux-usb@vger.kernel.org \
--cc=rogerq@ti.com \
--cc=stern@rowland.harvard.edu \
--cc=tony@atomide.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.