[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180816142443.GA5282@lunn.ch>
Date: Thu, 16 Aug 2018 16:24:43 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Ahmad Fatoum <a.fatoum@...gutronix.de>
Cc: Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
"David S. Miller" <davem@...emloft.net>,
Nicolas Ferre <nicolas.ferre@...rochip.com>,
netdev@...r.kernel.org, mdf@...nel.org, stable@...r.kernel.org,
kernel@...gutronix.de, Brad Mouring <brad.mouring@...com>,
Florian Fainelli <f.fainelli@...il.com>
Subject: Re: [PATCH] net: macb: Fix regression breaking non-MDIO fixed-link
PHYs
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
Powered by blists - more mailing lists