From patchwork Thu Dec 13 16:02:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 10729057 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 3810C174F for ; Thu, 13 Dec 2018 16:03:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 288D22C4A4 for ; Thu, 13 Dec 2018 16:03:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C6532C619; Thu, 13 Dec 2018 16:03:11 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 EDB6A2C647 for ; Thu, 13 Dec 2018 16:03:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728965AbeLMQDJ (ORCPT ); Thu, 13 Dec 2018 11:03:09 -0500 Received: from lelv0142.ext.ti.com ([198.47.23.249]:45330 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727942AbeLMQDJ (ORCPT ); Thu, 13 Dec 2018 11:03:09 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id wBDG2pwb004187; Thu, 13 Dec 2018 10:02:51 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1544716971; bh=VuRZwKHBaR0A5C0xX0EiIepA01UHWOcVipRSVu5gF/k=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=BCxjCs/O4oYrxe/Twn5ZxRhbYlhJ7krc76EFdhubJnUsHlvxT4wsUhRZYvSHqvSqV IWczb35wxzZ3ENE/+0/JfzYfU2QoHzqfIr/k4bWHu8JegbLaO/Rn9EpazbzFkm7LwI Tx59C/afobq9v2mWwOFYN/UESZNcdRzS2Oxwa+VU= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id wBDG2pXl108172 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 13 Dec 2018 10:02:51 -0600 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Thu, 13 Dec 2018 10:02:51 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Thu, 13 Dec 2018 10:02:51 -0600 Received: from dlelxv97.itg.ti.com (dlelxv97.itg.ti.com [172.17.2.193]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id wBDG2pY3011334; Thu, 13 Dec 2018 10:02:51 -0600 Received: from localhost.localdomain (vboxa0400828d.dhcp.ti.com [172.22.237.178]) by dlelxv97.itg.ti.com (8.14.3/8.13.8) with ESMTP id wBDG2j7q010765; Thu, 13 Dec 2018 10:02:46 -0600 From: Roger Quadros To: CC: , Roger Quadros , Alan Stern , Johan Hovold , Ladislav Michl , Peter Ujfalusi , Tony Lindgren Subject: [PATCH v2] usb: ehci-omap: Fix deferred probe for phy handling Date: Thu, 13 Dec 2018 18:02:32 +0200 Message-ID: <1544716952-13482-1-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <20181213021723.49798-1-tony@atomide.com> References: <20181213021723.49798-1-tony@atomide.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 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 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. Cc: Alan Stern Cc: Johan Hovold Cc: Ladislav Michl Cc: Peter Ujfalusi Cc: Tony Lindgren Reported-by: Peter Ujfalusi Signed-off-by: Roger Quadros Acked-by: Tony Lindgren --- drivers/usb/host/ehci-omap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index 7e4c1334..0eacbf4 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c @@ -159,9 +159,11 @@ 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)