Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp4594402pja; Thu, 21 Nov 2019 22:30:34 -0800 (PST) X-Google-Smtp-Source: APXvYqxCq6vrH0I0D/hA3qm3+GjMF8LesHcdhQiIR8fae4t3sBTD53yfryaL1whFgb7FyiHxC9EP X-Received: by 2002:a17:906:69cb:: with SMTP id g11mr19785170ejs.328.1574404234783; Thu, 21 Nov 2019 22:30:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574404234; cv=none; d=google.com; s=arc-20160816; b=A5DPGRNqqY1WB+1h6wQk7HTVnmcCttYrtmEKuWHw07LxKC5eveCB25FhZRUcC4Xnpd FJGmL3Dskh4QOtG/iIrTVCP0kQ2n4fuOG+H6U8ee6DvKamWYOX4Au261JaLL5eFt6HEa SRAkehrVijVeODwpPikZ5vdNZc8iLNJmRGqtu0evPqvTrowPhEEXBg7PIHx8PgYqamUu tKYdtFrHdmvJPVatchxtlEVl9IOh1VOKU4bZkMDdoPx1Y5FBg98zop0C8TPJbiAEUdbj RCQ6nU5gF7QvIcZD/Hr3cylAbZzXtJB8ReET5o72L8k5QNLa3yU5WzxRjhgxwvRJ1qCR o9Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vjMvLM+M4+ncS7sNu+b7al4QjfK/jf5Qc90em9tyGjo=; b=JmEWBwK1nshADREEd8XzmCPKS9whyzp1S4vWZcFAoKjI1ex5Tffh1nTte1+HqzORZB blWHzp6fl8CqehwE47S/5FX0S8OIU/SxnBe13esZ/eCv/HfzAnekU5mWB+lupz7RecxM ryoyXvyHg2i89r/GkXeJIeXSYasdVZ5baIpZQnaDwABmVCaQV4LvhAarym2/k3SNGR94 oWpZiceP4KDMYWVIz7TI8YaSCfO4Jv6RuTVVkD8Ifb9NqwtfgTvw5t9dK1Qo91xEnoHT 3Kvnqn6aIqbGq0W3pB9bsddtixV4K3PvxbPQtG/sejKbT/inMNeEOSKXoF0w/ItN25FF blhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VfaJo8jL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z26si3571646ejb.223.2019.11.21.22.30.11; Thu, 21 Nov 2019 22:30:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@kernel.org header.s=default header.b=VfaJo8jL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727753AbfKVFuc (ORCPT + 99 others); Fri, 22 Nov 2019 00:50:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:55008 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727725AbfKVFu3 (ORCPT ); Fri, 22 Nov 2019 00:50:29 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 459102070E; Fri, 22 Nov 2019 05:50:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574401828; bh=ifwruHAoHqHKLv+HjbF5JGJp7pgttRgm2PgncmfAWrs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VfaJo8jLZPKwwa0r//JrrvKBAgjxaNFkyNE4qqLAqDgshZ91g+LJ+dJ5kQfEuIwau CwtLJWd28IDprh9rFlelG0ZF/+Dqivb2XdmQr2TUv/ZiQ5g0U24QBq36rhU+bd7QvX pF4i96dpqaCBdRofT9naouugx1q+WvUmNaHvOWYo= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Roger Quadros , Johan Hovold , Ladislav Michl , Peter Ujfalusi , Tony Lindgren , Alan Stern , Greg Kroah-Hartman , Sasha Levin , linux-usb@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 070/219] usb: ehci-omap: Fix deferred probe for phy handling Date: Fri, 22 Nov 2019 00:46:42 -0500 Message-Id: <20191122054911.1750-63-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191122054911.1750-1-sashal@kernel.org> References: <20191122054911.1750-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Roger Quadros [ Upstream commit 8dc7623bf608495b6e6743e805807c7840673573 ] 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: Johan Hovold Cc: Ladislav Michl Reported-by: Peter Ujfalusi Signed-off-by: Roger Quadros Tested-by: Peter Ujfalusi Acked-by: Tony Lindgren Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/host/ehci-omap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index 7e4c13346a1ee..7d20296cbe9f9 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); -- 2.20.1