linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: macb: Fix handling of fixed-link node
@ 2020-03-31  9:39 Codrin Ciubotariu
  2020-03-31 17:07 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Codrin Ciubotariu @ 2020-03-31  9:39 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: nicolas.ferre, davem, antoine.tenart, andrew, f.fainelli,
	Codrin Ciubotariu, Cristian Birsan

fixed-link nodes are treated as PHY nodes by of_mdiobus_child_is_phy().
We must check if the interface is a fixed-link before looking up for PHY
nodes.

Fixes: 7897b071ac3b ("net: macb: convert to phylink")
Tested-by: Cristian Birsan <cristian.birsan@microchip.com>
Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
---
 drivers/net/ethernet/cadence/macb_main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 2c28da1737fe..b3a51935e8e0 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -724,6 +724,9 @@ static int macb_mdiobus_register(struct macb *bp)
 {
 	struct device_node *child, *np = bp->pdev->dev.of_node;
 
+	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
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: macb: Fix handling of fixed-link node
  2020-03-31  9:39 [PATCH] net: macb: Fix handling of fixed-link node Codrin Ciubotariu
@ 2020-03-31 17:07 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-03-31 17:07 UTC (permalink / raw)
  To: codrin.ciubotariu
  Cc: netdev, linux-kernel, nicolas.ferre, antoine.tenart, andrew,
	f.fainelli, cristian.birsan

From: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Date: Tue, 31 Mar 2020 12:39:35 +0300

> fixed-link nodes are treated as PHY nodes by of_mdiobus_child_is_phy().
> We must check if the interface is a fixed-link before looking up for PHY
> nodes.
> 
> Fixes: 7897b071ac3b ("net: macb: convert to phylink")
> Tested-by: Cristian Birsan <cristian.birsan@microchip.com>
> Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-31 17:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-31  9:39 [PATCH] net: macb: Fix handling of fixed-link node Codrin Ciubotariu
2020-03-31 17:07 ` David Miller

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).