linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@ti.com>
To: Tony Lindgren <tony@atomide.com>,
	Greg Kroah-Hartman <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>,
	Peter Ujfalusi <peter.ujfalusi@ti.com>
Subject: USB: ehci-omap: Fix deferred probe for phy handling
Date: Thu, 13 Dec 2018 14:08:54 +0200	[thread overview]
Message-ID: <5C124BD6.6020901@ti.com> (raw)

Tony,

On 13/12/18 04:17, Tony Lindgren wrote:
> The only case where we can bail out safely without a phy is port_mode
> is OMAP_USBHS_PORT_MODE_UNUSED. It used to be that OMAP_EHCI_PORT_MODE_PHY
> was optional, but that's not a good assumption. We should already have
> "ehci-phy" in all the dts files using OMAP_EHCI_PORT_MODE_PHY.
> 

We don't use the PHY at all if port mode is not OMAP_EHCI_PORT_MODE_PHY.

> Note that this fix should not be needed for kernels earlier than v4.19
> as that's when we started moving devices to probe with ti-sysc. We now
> probe l4 interconnects separately, which can cause deferred probe with
> the phy being on a separate l4 interconnect from EHCI.
> 
> And old kernels would need to be checked for "ehci-phy" property for
> this fix to avoid regressions.
> 

What issue is this patch fixing?

> 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: Roger Quadros <rogerq@ti.com>
> Reported-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  drivers/usb/host/ehci-omap.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
> --- a/drivers/usb/host/ehci-omap.c
> +++ b/drivers/usb/host/ehci-omap.c
> @@ -159,8 +159,8 @@ 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)
> +			/* Don't bail out if PHY is unused */
> +			if (pdata->port_mode[i] == OMAP_USBHS_PORT_MODE_UNUSED)
>  				continue;
>  
>  			ret = PTR_ERR(phy);

devm_usb_get_phy_by_phandle() returns -ENODEV if PHY phandle is not present
which would be the case in PHY'less modes (e.g. "ehci-tll" or "ehci-hsic").
This change will error out instead of proceeding normally in those cases.

cheers,
-roger

             reply	other threads:[~2018-12-13 12:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-13 12:08 Roger Quadros [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-12-13 14:34 USB: ehci-omap: Fix deferred probe for phy handling Tony Lindgren
2018-12-13  7:25 Peter Ujfalusi
2018-12-13  2:17 Tony Lindgren

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=5C124BD6.6020901@ti.com \
    --to=rogerq@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=ladis@linux-mips.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.ujfalusi@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 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).