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: "David S. Miller" <davem@davemloft.net>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	kernel@pengutronix.de, netdev@vger.kernel.org, mdf@kernel.org,
	Brad Mouring <brad.mouring@ni.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH 1/4] net: macb: Fix regression breaking non-MDIO fixed-link PHYs
Date: Mon, 20 Aug 2018 15:55:36 +0200	[thread overview]
Message-ID: <20180820135536.GD6583@lunn.ch> (raw)
In-Reply-To: <20180820121238.7779-1-a.fatoum@pengutronix.de>

On Mon, Aug 20, 2018 at 02:12:35PM +0200, Ahmad Fatoum wrote:
> The referenced commit broke initializing macb on the EVB-KSZ9477 eval board.
> There, of_mdiobus_register was called even for the fixed-link representing
> the SPI-connected switch PHY, with the result that the driver attempts to
> enumerate PHYs on a non-existent MDIO bus:
> 
> 	libphy: MACB_mii_bus: probed

So there are two different things here:

> 	mdio_bus f0028000.ethernet-ffffffff: fixed-link has invalid PHY address
> 	mdio_bus f0028000.ethernet-ffffffff: scan phy fixed-link at address 0
>         [snip]
> 	mdio_bus f0028000.ethernet-ffffffff: scan phy fixed-link at address 31

These are the result of the fixed-link being considered a PHY in
of_mdiobus_register(). Patch 2 fixes that, turns it into a single
warning.

> 	macb f0028000.ethernet: broken fixed-link specification

Why is of_phy_register_fixed_link(np) failing?

> 
> Cc: <stable@vger.kernel.org>
> Fixes: 739de9a1563a ("net: macb: Reorganize macb_mii bringup")
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  drivers/net/ethernet/cadence/macb_main.c | 27 +++++++++++++++---------
>  1 file changed, 17 insertions(+), 10 deletions(-)
> 
> Fixes since v1:
> 	Added one more error path for failing to register fixed-link
> 	Fixed a whitespace issue
> 
> 
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index dc09f9a8a49b..ef6ce8691443 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -482,11 +482,6 @@ static int macb_mii_probe(struct net_device *dev)
>  
>  	if (np) {
>  		if (of_phy_is_fixed_link(np)) {
> -			if (of_phy_register_fixed_link(np) < 0) {
> -				dev_err(&bp->pdev->dev,
> -					"broken fixed-link specification\n");
> -				return -ENODEV;
> -			}

As a separate patch, please can you use the error code which
of_phy_register_fixed_link() returns, not -ENODEV. It is possible it
is returning EPROBE_DEFER.

   Andrew

  parent reply	other threads:[~2018-08-20 13:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-20 12:12 [PATCH 1/4] net: macb: Fix regression breaking non-MDIO fixed-link PHYs Ahmad Fatoum
2018-08-20 12:12 ` [PATCH 2/4] of: phy: Warn about unexpected fixed-links in of_mdiobus_register Ahmad Fatoum
2018-08-20 12:31   ` Ahmad Fatoum
2018-08-20 13:37   ` Andrew Lunn
2018-08-20 13:51     ` Ahmad Fatoum
2018-08-20 12:12 ` [PATCH 3/4] net: macb: Support specifying PHYs in a mdio container dts node Ahmad Fatoum
2018-08-20 13:42   ` Andrew Lunn
2018-08-20 13:45     ` Ahmad Fatoum
2018-08-20 13:56       ` Andrew Lunn
2018-08-20 12:12 ` [PATCH 4/4] ARM: dts: macb: wrap macb PHYs in a mdio container Ahmad Fatoum
2018-08-20 13:55 ` Andrew Lunn [this message]
2018-08-20 15:56   ` [PATCH 1/4] net: macb: Fix regression breaking non-MDIO fixed-link PHYs Ahmad Fatoum
2018-08-20 19:06     ` Andrew Lunn
2018-08-21  8:26       ` Ahmad Fatoum
2018-08-21 13:34         ` Andrew Lunn
2018-08-21 14:59           ` 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=20180820135536.GD6583@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 \
    /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).