Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934150AbeALRiD (ORCPT + 1 other); Fri, 12 Jan 2018 12:38:03 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:51077 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932859AbeALRiA (ORCPT ); Fri, 12 Jan 2018 12:38:00 -0500 Date: Fri, 12 Jan 2018 18:37:13 +0100 (CET) From: Stefan Wahren To: Kishon Vijay Abraham I , Greg Kroah-Hartman , Arnd Bergmann Cc: Eric Anholt , linux-kernel@vger.kernel.org, Rob Herring , Andrzej Pietrasiewicz , John Youn , Florian Fainelli , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, stable@vger.kernel.org, Felipe Balbi , Dinh Nguyen , Fabio Estevam , Vitaly Andrianov , Javier Martinez Canillas , Alexandre Torgue Message-ID: <971903888.21300.1515778633323@email.1und1.de> In-Reply-To: <20180112101223.3661181-1-arnd@arndb.de> References: <20180112101223.3661181-1-arnd@arndb.de> Subject: Re: [PATCH] phy: work around 'phys' references to usb-nop-xceiv devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.4-Rev20 X-Originating-Client: open-xchange-appsuite X-Provags-ID: V03:K0:EI8CDL1EJNZKDfJC5WrE/hMizp9QrgnQNZnQmF7MscCe8teEzGc 6njwCRrqpQfSTZizkZgzzwOwGkyz/vItx5HWMSxSzPSPbquMEWBfJktQoEoYYnNnyG1aded Wad5ClA+4oKADmWghy0SbgFZAa0X6tEW3I/SW1/6hfXNGZ6kDHKFzD3wNEeMxMrcvhaHvtI xg+tZHToEPqAoZS1PzbRA== X-UI-Out-Filterresults: notjunk:1;V01:K0:kPz+K4AzaJc=:cCrLiRKw7RvImNOYkuj/VY +1ZyMSMvmFuIRB3tyn2EVr4Km4CJjSBFXV1tiyM5g9Hk6cpL834U1Sm/Toen5mi8Yh7HxOpoI m4XGULh0EMxWzOM+/iwnhKVihNug16yHXVCTg5F4lfAteq6k3FkhpMzW97JW6OmRRufb6IqFs Hb6w78dbXMRGAhOiKgfUPF7eAGbTE2Orqr0zDMM/i5zzoyO8iRQbZygJ8Y6U9AX4RJVn+IZJP xCU040Gu21dy/HXGrB2/8jATb3pUJOns/wlBM2+2xXOlmiaXWqoBXulr/oBN6WEySjWcO903Q oy1gYbrlSBhFGf/ptuea37E0a18qj22jisQNOd22R3NX02YFJWiBYuiNuZ+WdTY/mIwvFkO6f cUmto61PYsJx8IBsbOrKWcheECKmQRckpLyCnwlwJgKFSAaEvjq1+9hEVuEB4aznfgq6x9HY0 qOu3eSLGvFVgxcm7y8L6CLPl/CXBpPUNrPPpfBcRw1A4qB+/RpsVqYdcBvj2JczGmllpEnHPq TrXtQyA4v+DiN11BBDYlAM1Dcz/oPsBaxqrxs3chvQVQ1wSbte6BS+IV+4lEEGl9WPhITvq+r 1Is42/y63oMvyEezKfg8QWvvDK/xdeq7xccV4p/5D1n7XwzE37FZEcHP0BiAojm3GfFt5l9Lw 1BcxgP+POJt4Cm81N+31xmWxaMXhZY6ZC78GirgivAl7MuK2EY5v1m2VNtMiK2CtJ+PllKRGV xmWNrl0/xfh0a3nC/jz/T8zfFw/S7dJCu++v0pytJ1XI390Ggt2/s4io3qg= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: [add some potential testers] > Arnd Bergmann hat am 12. Januar 2018 um 11:12 geschrieben: > > > 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: stable@vger.kernel.org > Cc: Stefan Wahren > Cc: Felipe Balbi > Cc: Eric Anholt > Tested-by: Hans Verkuil > Acked-by: Kishon Vijay Abraham I > Signed-off-by: Arnd Bergmann Tested-by: Stefan Wahren > --- > drivers/phy/phy-core.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c > index b4964b067aec..8f6e8e28996d 100644 > --- a/drivers/phy/phy-core.c > +++ b/drivers/phy/phy-core.c > @@ -410,6 +410,10 @@ static struct phy *_of_phy_get(struct device_node *np, int index) > 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)) { > -- > 2.9.0 >