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: 153695 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp969336ljp; Thu, 13 Dec 2018 08:03:10 -0800 (PST) X-Google-Smtp-Source: AFSGD/WH2zGiojF4FrLsmopXd4V6RFwlQrYHwam97a9ZNRUIfXyq+82UE09PgIgLkOVjtE4QdGfA X-Received: by 2002:a17:902:4225:: with SMTP id g34mr24756280pld.152.1544716990218; Thu, 13 Dec 2018 08:03:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544716990; cv=none; d=google.com; s=arc-20160816; b=Ylu7Hp4aKbPV3wdeWOnwmiGakc7N1jtpNSo2ruYRZy+0nSlcAnd06K/C6oc0/Agphm 3CrxgHrNFRPKHNv9zf7lq4/EozxfyBS8Cm6z2FqWJIihDnmoniw/x80jkdlHbns+wCsh xeye3TpcB/k5IU5zXbiqRKOAVO7Ar4J1oU5AT6/5gUobE2o4i8PnaNTFmiX1rHdDDzR6 hJMkn2E8lVoKrisDPChnMxUpzit5UAV+A0049VgqyC6gABQKyNl4qrHlADsvnGMJQMbc T0kGxIFBY6My4HcxGdBpicfJ15tPXBWBaWccUCpvyz0rR2IF5niwXnMN6TOEN+XYjmZy k7eA== 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=VuRZwKHBaR0A5C0xX0EiIepA01UHWOcVipRSVu5gF/k=; b=QfLYE5L6F4EFTVO4aJIVoQTm5kwlb4Y1Lwv2UKyL0dmoVy43EqpJZz15rOH3/k+QA7 uCduc4wsBfH5tHqHMlJpdW1r+MzTTtKBhTIO+9hLpfIsK+KopNG75QSwFHvSRtF33R4F jtWZaaUXXqIgU5n7pfLuf3Fv5rNNh+PZr0nEcOZ4nTuOXZJJ4/zZs0pC02n7vi3VPOxQ Dm9jyhFCqNo5mZsbEhH4F7BwO7+CYLlF4EBdLg3aJTKhkevcWFieQKrDvOvjeG5O2Ebk iXXXotbc2NTmKJAPEiEDVf8Ef1SB8MuyUipbGomJ9PPNJjX0+GQ7H47AXbKqFrMX6lY5 wmDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="BCxjCs/O"; 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 t6si1874307pgn.258.2018.12.13.08.03.09; Thu, 13 Dec 2018 08:03:10 -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="BCxjCs/O"; 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 S1728965AbeLMQDJ (ORCPT + 5 others); 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 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki Acked-by: Tony Lindgren 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)