Received: by 10.223.176.46 with SMTP id f43csp2674595wra; Mon, 22 Jan 2018 01:21:10 -0800 (PST) X-Google-Smtp-Source: AH8x225ojClnVkrWBjTbgSp6NAdSWs6pVByW6BQ1bCWe7qEeZViu+vj2MgKI88SDXwgh1+Ficgl2 X-Received: by 2002:a17:902:40a:: with SMTP id 10-v6mr3037568ple.88.1516612870561; Mon, 22 Jan 2018 01:21:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516612870; cv=none; d=google.com; s=arc-20160816; b=Wv+T48nupdbx5WvXlPlxkX5Y+VpYsHTW4YhYJ21bax823kmyg2ebTTHqiBzE4aTp3u 4a+sTLGT512XwALLx1QRIqjMZoP0mmBjVPD/IwID85+pFDcGATwSvhSWwseBunTW7qCz jwPDX3Dg1Sde6H0KHGq/P2KT+6GYnl4jAWKk4zMx126Jryil42eEPZba+BIh0TwzTOUt irH9tMQiaXlrb6r7J+jMpxZaRQfdy8hU6XxmAGPBMpDXpv5mDB99UKq0XXdXxzmb5xqd pk8eOzdrIoFG+YAhzJKQQzIhUMoplwlC7xfK2KYCJKrdIR1YWDbhfDRFV9sjQS3aE6e4 HbxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=JAChHk1HrRiZXRsnzXpmKh3pnYMhkEjWd9+7nWIX7yo=; b=A8ZY/Ic4hQByy9IYAsYEMMyBYePe2DgXWxtXNp6lA6nrHKyanUadtXf8XiGeG788f6 tKNfsmdPww01t040lVFiXS1nOrhJtQpdijLHYv+Krtor4/bFhOJuv2XD1tbeu7ElmpSS fTaASjmxOq5E2zYPIEmhzg4cQnQFwSCqua2CKeKI0eR+AsZVJuqgw9A9Bj3I/YDyYhhx CxXIPwUIyJ5GrCkASfvy27dtj5U6m/exzudIVtOT4JpXJCZ+rvOqSaN+zFINyIoSPSYg vgpUlTRQPhyNWLoEWUrd1s3kWji2vls2WGxA58c9tqhWJYlHR8azJxmk6Gz2JfujG2sR zxDw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r83si15202623pfd.355.2018.01.22.01.20.56; Mon, 22 Jan 2018 01:21:10 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752581AbeAVIuS (ORCPT + 99 others); Mon, 22 Jan 2018 03:50:18 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:60960 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751091AbeAVIuQ (ORCPT ); Mon, 22 Jan 2018 03:50:16 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id A8C44491; Mon, 22 Jan 2018 08:50:15 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Felipe Balbi , Eric Anholt , Stefan Wahren , Rob Herring , Hans Verkuil , Kishon Vijay Abraham I , Arnd Bergmann Subject: [PATCH 4.9 29/47] phy: work around phys references to usb-nop-xceiv devices Date: Mon, 22 Jan 2018 09:45:40 +0100 Message-Id: <20180122083927.912986786@linuxfoundation.org> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180122083925.568134913@linuxfoundation.org> References: <20180122083925.568134913@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann commit b7563e2796f8b23c98afcfea7363194227fa089d upstream. Stefan Wahren reports a problem with a warning fix that was merged for v4.15: we had lots of device nodes with a 'phys' property pointing to a device node that is not compliant with the binding documented in Documentation/devicetree/bindings/phy/phy-bindings.txt This generally works because USB HCD drivers that support both the generic phy subsystem and the older usb-phy subsystem ignore most errors from phy_get() and related calls and then use the usb-phy driver instead. However, it turns out that making the usb-nop-xceiv device compatible with the generic-phy binding changes the phy_get() return code from -EINVAL to -EPROBE_DEFER, and the dwc2 usb controller driver for bcm2835 now returns -EPROBE_DEFER from its probe function rather than ignoring the failure, breaking all USB support on raspberry-pi when CONFIG_GENERIC_PHY is enabled. The same code is used in the dwc3 driver and the usb_add_hcd() function, so a reasonable assumption would be that many other platforms are affected as well. I have reviewed all the related patches and concluded that "usb-nop-xceiv" is the only USB phy that is affected by the change, and since it is by far the most commonly referenced phy, all the other USB phy drivers appear to be used in ways that are are either safe in DT (they don't use the 'phys' property), or in the driver (they already ignore -EPROBE_DEFER from generic-phy when usb-phy is available). To work around the problem, this adds a special case to _of_phy_get() so we ignore any PHY node that is compatible with "usb-nop-xceiv", as we know that this can never load no matter how much we defer. In the future, we might implement a generic-phy driver for "usb-nop-xceiv" and then remove this workaround. Since we generally want older kernels to also want to work with the fixed devicetree files, it would be good to backport the patch into stable kernels as well (3.13+ are possibly affected), even though they don't contain any of the patches that may have caused regressions. Fixes: 014d6da6cb25 ARM: dts: bcm283x: Fix DTC warnings about missing phy-cells Fixes: c5bbf358b790 arm: dts: nspire: Add missing #phy-cells to usb-nop-xceiv Fixes: 44e5dced2ef6 arm: dts: marvell: Add missing #phy-cells to usb-nop-xceiv Fixes: f568f6f554b8 ARM: dts: omap: Add missing #phy-cells to usb-nop-xceiv Fixes: d745d5f277bf ARM: dts: imx51-zii-rdu1: Add missing #phy-cells to usb-nop-xceiv Fixes: 915fbe59cbf2 ARM: dts: imx: Add missing #phy-cells to usb-nop-xceiv Link: https://marc.info/?l=linux-usb&m=151518314314753&w=2 Link: https://patchwork.kernel.org/patch/10158145/ Cc: Felipe Balbi Cc: Eric Anholt Tested-by: Stefan Wahren Acked-by: Rob Herring Tested-by: Hans Verkuil Acked-by: Kishon Vijay Abraham I Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- drivers/phy/phy-core.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c @@ -395,6 +395,10 @@ static struct phy *_of_phy_get(struct de if (ret) return ERR_PTR(-ENODEV); + /* This phy type handled by the usb-phy subsystem for now */ + if (of_device_is_compatible(args.np, "usb-nop-xceiv")) + return ERR_PTR(-ENODEV); + mutex_lock(&phy_provider_mutex); phy_provider = of_phy_provider_lookup(args.np); if (IS_ERR(phy_provider) || !try_module_get(phy_provider->owner)) {