From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH] net: macb: Fix regression breaking non-MDIO fixed-link PHYs Date: Thu, 16 Aug 2018 16:24:43 +0200 Message-ID: <20180816142443.GA5282@lunn.ch> References: <20180814141240.9085-1-a.fatoum@pengutronix.de> <20180814155812.cjuacvkhqeuctcry@pengutronix.de> <20180815023233.GD11610@lunn.ch> <0c96cf1e-9126-71ca-802f-92b3d3ba59f7@pengutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , "David S. Miller" , Nicolas Ferre , netdev@vger.kernel.org, mdf@kernel.org, stable@vger.kernel.org, kernel@pengutronix.de, Brad Mouring , Florian Fainelli To: Ahmad Fatoum Return-path: Content-Disposition: inline In-Reply-To: <0c96cf1e-9126-71ca-802f-92b3d3ba59f7@pengutronix.de> Sender: stable-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Thu, Aug 16, 2018 at 08:54:40AM +0200, Ahmad Fatoum wrote: > On 08/15/2018 04:32 AM, Andrew Lunn wrote: > > Ahmed, where is the device tree for the EVB-KSZ9477? > > I've attached it [1]. It's still work-in-progress (DSA doesn't work yet for example), but Ethernet is usable with Linux v4.18 and my patch applied. > Thanks. So the problem is, macb does not put phy DT nodes inside an mdio subnode. It places them directly in the MAC node. So of_mdiobus_register() is being called with the MAC np. of_mdiobus_register() then looks for children of the MAC node, assuming they are phys. But when you have a fixed phy node, it is not a phy, it does not have a reg property, and you get these warnings. There are cases when you need both fixed-phy and a mdio bus. e.g. a DSA switch hanging off MDIO. So we have a few things here... 1) A regression. We should find a fix for that. Maybe we should special case a child node called 'fixed-link' in of_mdiobus_register(). I would suggest adding a single warning if such node is found. 2) Missing functionality. Add support for an mdio container node. node = of_get_child_by_name(np, "mdio"); if (node) err = of_mdiobus_register(bp->mii_bus, node); else err = of_mdiobus_register(bp->mii_bus, np); 3) Modify the existing dts files to make use of this container. Because of backwards compatibility, we cannot force the use of it, but we can encourage it. Andrew