From patchwork Fri Dec 14 09:36:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 153789 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1851181ljp; Fri, 14 Dec 2018 01:36:41 -0800 (PST) X-Google-Smtp-Source: AFSGD/VyW+Xe0+EdBnRyPgeRrR7cYw2RgvSPaJeXikiTCkerdAN0tbmZqcLlthhO8dfwTFy0DAjg X-Received: by 2002:a17:902:5a5:: with SMTP id f34mr2201054plf.161.1544780201277; Fri, 14 Dec 2018 01:36:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544780201; cv=none; d=google.com; s=arc-20160816; b=xFMC6cPyBV3DUeEy9WXPKpG6Z1MLjvloC138TgP+TIF2+yd3S1gSoiRsTO5TZFoUcX jku+uUdSbPZxQLpssZ+LbAKph39xXPf6UjI50KtvGbbX2682DvaTNmmu7X8lpwCotv8H jkifR+f/LU+M8Kv9SLicFFUlgQVlmTPzf+jwJ2VM0OecK/ucLspUfkVDLj9FyD7bH3IT QTAFaj4FENXDEDHgSvSybgZitQhcSQMb5Ss7AmF1d6HW8nPxL5OS+yizMwjylyHdqHba xWxQWRmGN8pCwlzSEn3bvDABvGIBrdTuJLNGDeEyxpw03x7FygCY6cYnIHuqblaxNapP 6BiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=UeOTw8CL+GhjBEDcQ7Qcx4HEjmFNgs8CvJdX1tkJtwk=; b=JHsUBED5VpMpes8P7V1Tg/WNWHD4fdRII7T1guYV9m374uNPqmXaCuhUYWZ48M4GZn hvVLm4OdfvArmzVdDJtT9ad/wYrB12z87ftUVWbmRe2P1dOoOv3FVdtryhD8PKGkTzFL TlRGbU+16UbrTZsy7ChxIZC1/+MUQZwkmF3tc1Mn+/y/Rr0ix7zyBwO0WxIMcw+EORaa ZYmas3eQCleuMOWKIA9xcC8EiTi1sp1fv2KaaMmb4/VuHVuMZNvsNqZNmyBkoGNO5p4Y cdX35NCzVtbRoMUUNEwUUB9rBZTkFJDiR5X2yDkyuYb/cifIAcBRqUIa9Vq5qKYknpiF Re0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Efuuu6VG; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w14si3569126plq.145.2018.12.14.01.36.41; Fri, 14 Dec 2018 01:36:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Efuuu6VG; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728827AbeLNJgk (ORCPT + 5 others); Fri, 14 Dec 2018 04:36:40 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:39754 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726494AbeLNJgj (ORCPT ); Fri, 14 Dec 2018 04:36:39 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id wBE9aSMY053270; Fri, 14 Dec 2018 03:36:28 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1544780188; bh=UeOTw8CL+GhjBEDcQ7Qcx4HEjmFNgs8CvJdX1tkJtwk=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Efuuu6VGu5jhdWc8auoAhbvhZ1TyecnstH9/j+6cd5zv0dMZjNb7c71S9O68twfaI bcyYvDLqUpFMAphwnmSUt2c6Avf2Vseenxk8kQTUTj9IMG+EMz+vY7nnuFXDUS91lV eK8Wm2cQPDpTDIHZQHomTgkLq8PmXNOiaiieOSZw= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id wBE9aSa7126138 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 14 Dec 2018 03:36:28 -0600 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Fri, 14 Dec 2018 03:36:28 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Fri, 14 Dec 2018 03:36:28 -0600 Received: from dlelxv97.itg.ti.com (dlelxv97.itg.ti.com [172.17.2.193]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id wBE9aRgJ021153; Fri, 14 Dec 2018 03:36:27 -0600 Received: from localhost.localdomain (vboxa0400828d.dhcp.ti.com [172.22.236.156]) by dlelxv97.itg.ti.com (8.14.3/8.13.8) with ESMTP id wBE9aPP5030738; Fri, 14 Dec 2018 03:36:25 -0600 From: Roger Quadros To: CC: , Roger Quadros , Alan Stern , Johan Hovold , Ladislav Michl , Peter Ujfalusi , Tony Lindgren Subject: [PATCH v3] usb: ehci-omap: Fix deferred probe for phy handling Date: Fri, 14 Dec 2018 11:36:15 +0200 Message-ID: <1544780175-17019-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 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 --- drivers/usb/host/ehci-omap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki Tested-by: Peter Ujfalusi Acked-by: Tony Lindgren Acked-by: Alan Stern 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);