From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH 1/4] net: macb: Fix regression breaking non-MDIO fixed-link PHYs Date: Mon, 20 Aug 2018 21:06:30 +0200 Message-ID: <20180820190630.GB12238@lunn.ch> References: <20180820121238.7779-1-a.fatoum@pengutronix.de> <20180820135536.GD6583@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "David S. Miller" , Nicolas Ferre , kernel@pengutronix.de, netdev@vger.kernel.org, mdf@kernel.org, Brad Mouring , Florian Fainelli , stable@vger.kernel.org To: Ahmad Fatoum Return-path: Content-Disposition: inline In-Reply-To: Sender: stable-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Mon, Aug 20, 2018 at 05:56:53PM +0200, Ahmad Fatoum wrote: > On 08/20/2018 03:55 PM, Andrew Lunn wrote: > > Why is of_phy_register_fixed_link(np) failing? > > Apparently, the fixed-link's gpio's FLAG_REQUESTED bit remained set > causing gpiod_request_commit to return -EBUSY in (v4.18.0): > > [] (gpiod_request_commit) from [] (gpiod_request+0x64/0x88) > [] (gpiod_request) from [] (gpiod_get_from_of_node+0x48/0x13c) > [] (gpiod_get_from_of_node) from [] (mdiobus_register_device+0x70/0x124) > [] (mdiobus_register_device) from [] (phy_device_register+0xc/0xa0) > [] (phy_device_register) from [] (fixed_phy_register+0xe8/0x1f8) > [] (fixed_phy_register) from [] (of_phy_register_fixed_link+0x150/0x1e4) > [] (of_phy_register_fixed_link) from [] (macb_probe+0x548/0xa7c) > [] (macb_probe) from [] (platform_drv_probe+0x48/0x98) > > But that's a separate issue, I'll remove this line from the commit message... I would actually say, this is your real issue here. The warnings are annoying, but i don't think they are fatal. This -EBUSY is what is stopping the driver from loading, causing the real regression. I'm guessing, but i think you will find the driver is loading once, but hits a EPROBE_DEFFER condition, after getting the gpio. It does not release the gpio correctly. Sometime later, it gets loaded again, but the gpio is now in use, so you get the -EBUSY. So check the error paths, and make sure cleanup is being done correct. It could also be a phylib core bug... Andrew