linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: 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>,
	Roger Quadros <rogerq@ti.com>
Subject: USB: ehci-omap: Fix deferred probe for phy handling
Date: Wed, 12 Dec 2018 18:17:23 -0800	[thread overview]
Message-ID: <20181213021723.49798-1-tony@atomide.com> (raw)

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.

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.

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);

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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-13  2:17 Tony Lindgren [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-12-13  7:25 USB: ehci-omap: Fix deferred probe for phy handling Peter Ujfalusi
2018-12-13 12:08 Roger Quadros
2018-12-13 14:34 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=20181213021723.49798-1-tony@atomide.com \
    --to=tony@atomide.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=rogerq@ti.com \
    --cc=stern@rowland.harvard.edu \
    /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).