From patchwork Thu Dec 13 02:17:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 10727627 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 023B016B1 for ; Thu, 13 Dec 2018 02:17:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E68A92BABF for ; Thu, 13 Dec 2018 02:17:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DAE0E2BAC9; Thu, 13 Dec 2018 02:17:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0BA32BABF for ; Thu, 13 Dec 2018 02:17:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726423AbeLMCR3 (ORCPT ); Wed, 12 Dec 2018 21:17:29 -0500 Received: from muru.com ([72.249.23.125]:57944 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726405AbeLMCR3 (ORCPT ); Wed, 12 Dec 2018 21:17:29 -0500 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 47261809F; Thu, 13 Dec 2018 02:17:32 +0000 (UTC) From: Tony Lindgren To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, Alan Stern , Johan Hovold , Ladislav Michl , Peter Ujfalusi , Roger Quadros Subject: [PATCH] USB: ehci-omap: Fix deferred probe for phy handling Date: Wed, 12 Dec 2018 18:17:23 -0800 Message-Id: <20181213021723.49798-1-tony@atomide.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Cc: Johan Hovold Cc: Ladislav Michl Cc: Peter Ujfalusi Cc: Roger Quadros Reported-by: Peter Ujfalusi Signed-off-by: Tony Lindgren Tested-by: Peter Ujfalusi --- 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);