netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"David S. Miller" <davem@davemloft.net>,
	"Nicolas Ferre" <nicolas.ferre@microchip.com>,
	netdev@vger.kernel.org, mdf@kernel.org, stable@vger.kernel.org,
	kernel@pengutronix.de, "Brad Mouring" <brad.mouring@ni.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>
Subject: Re: [PATCH] net: macb: Fix regression breaking non-MDIO fixed-link PHYs
Date: Thu, 16 Aug 2018 16:24:43 +0200	[thread overview]
Message-ID: <20180816142443.GA5282@lunn.ch> (raw)
In-Reply-To: <0c96cf1e-9126-71ca-802f-92b3d3ba59f7@pengutronix.de>

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

  reply	other threads:[~2018-08-16 14:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-14 14:12 [PATCH] net: macb: Fix regression breaking non-MDIO fixed-link PHYs Ahmad Fatoum
2018-08-14 15:58 ` Uwe Kleine-König
2018-08-15  2:03   ` Brad Mouring
2018-08-15  2:32   ` Andrew Lunn
2018-08-15 13:59     ` Lad, Prabhakar
2018-08-20 12:37       ` Ahmad Fatoum
2018-08-16  6:54     ` Ahmad Fatoum
2018-08-16 14:24       ` Andrew Lunn [this message]
2018-08-20 12:17         ` Ahmad Fatoum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180816142443.GA5282@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=a.fatoum@pengutronix.de \
    --cc=brad.mouring@ni.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=mdf@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=stable@vger.kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).