mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	stable@vger.kernel.org, kernel@pengutronix.de,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Subject: Re: [PATCH net v1 1] net: macb: Avoid 20s boot delay by skipping MDIO bus registration for fixed-link PHY
Date: Sat, 12 Oct 2024 20:14:43 +0200	[thread overview]
Message-ID: <379d10d5-468c-4d88-984e-df9ddc52f28e@lunn.ch> (raw)
In-Reply-To: <20241010105101.3128090-1-o.rempel@pengutronix.de>

> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index f06babec04a0b..e4ee55bc53ba7 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -930,9 +930,6 @@ static int macb_mdiobus_register(struct macb *bp)
>  		return ret;
>  	}
> 
> -	if (of_phy_is_fixed_link(np))
> -		return mdiobus_register(bp->mii_bus);
> -
>  	/* Only create the PHY from the device tree if at least one PHY is
>  	 * described. Otherwise scan the entire MDIO bus. We do this to support
>  	 * old device tree that did not follow the best practices and did not
> @@ -953,8 +950,19 @@ static int macb_mdiobus_register(struct macb *bp)
> 
>  static int macb_mii_init(struct macb *bp)
>  {
> +	struct device_node *child, *np = bp->pdev->dev.of_node;
>  	int err = -ENXIO;
> 
> +	/* With fixed-link, we don't need to register the MDIO bus,
> +	 * except if we have a child named "mdio" in the device tree.
> +	 * In that case, some PHYs may be attached to the MACB's MDIO bus.

nitpick. It could be a switch on the MDIO bus, so "some devices may
be"

> +	 */
> +	child = of_get_child_by_name(np, "mdio");
> +	if (child)
> +		of_node_put(child);

The code now gets this node twice. You could add an optimisation patch
which passed child to macb_mdiobus_register().

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

      reply	other threads:[~2024-10-12 18:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-10 10:51 Oleksij Rempel
2024-10-12 18:14 ` Andrew Lunn [this message]

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=379d10d5-468c-4d88-984e-df9ddc52f28e@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=claudiu.beznea@microchip.com \
    --cc=codrin.ciubotariu@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=o.rempel@pengutronix.de \
    --cc=pabeni@redhat.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

all inboxes | Powered by JetHome®