mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next] net: mdio: handle broken-turn-around for non-PHY MDIO devices
@ 2026-11-19 23:13 Bastian Germann
  0 siblings, 0 replies; only message in thread
From: Bastian Germann @ 2026-11-19 23:13 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni
  Cc: Russell King, netdev, linux-kernel, Vladimir Oltean, Bastian Germann

The "broken-turn-around" property is documented in mdio.yaml for any
MDIO device, but the MDIO core currently parses it only for PHY devices
in fwnode_mdiobus_phy_device_register(). Non-PHY devices, such as DSA
switches, are registered through of_mdiobus_register_device(), where the
property is ignored, so MDIO bus drivers that rely on phy_ignore_ta_mask
still treat the turn-around/read failure as an error.

Parse the property when registering a non-PHY MDIO device and set the
corresponding bit in phy_ignore_ta_mask before registering the device.

Signed-off-by: Bastian Germann <bage@debian.org>
---
 drivers/net/mdio/of_mdio.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/mdio/of_mdio.c b/drivers/net/mdio/of_mdio.c
index b8d298c04d3f..0695ae83b83b 100644
--- a/drivers/net/mdio/of_mdio.c
+++ b/drivers/net/mdio/of_mdio.c
@@ -56,6 +56,9 @@ static int of_mdiobus_register_device(struct mii_bus *mdio,
 	struct mdio_device *mdiodev;
 	int rc;
 
+	if (fwnode_property_read_bool(fwnode, "broken-turn-around"))
+		mdio->phy_ignore_ta_mask |= BIT(addr);
+
 	mdiodev = mdio_device_create(mdio, addr);
 	if (IS_ERR(mdiodev))
 		return PTR_ERR(mdiodev);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-19 23:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-19 23:13 [PATCH net-next] net: mdio: handle broken-turn-around for non-PHY MDIO devices Bastian Germann

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®