From: Bastian Germann <bage@debian.org>
To: andrew@lunn.ch
Cc: hkallweit1@gmail.com, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com, linux@armlinux.org.uk,
olteanv@gmail.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Bastian Germann <bage@debian.org>
Subject: [PATCH net-next v2] net: mdio: handle broken-turn-around for non-PHY MDIO devices
Date: Sat, 21 Nov 2026 10:29:33 +0100 [thread overview]
Message-ID: <20261121092933.186731-1-bage@debian.org> (raw)
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 in of_mdiobus_register_phy() and
of_mdiobus_register_device() instead, so it is handled in one place for
both PHYs and other MDIO devices, and drop it from
fwnode_mdiobus_phy_device_register().
Signed-off-by: Bastian Germann <bage@debian.org>
---
drivers/net/mdio/fwnode_mdio.c | 3 ---
drivers/net/mdio/of_mdio.c | 6 ++++++
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/mdio/fwnode_mdio.c b/drivers/net/mdio/fwnode_mdio.c
index ba7091518265..129481e8a910 100644
--- a/drivers/net/mdio/fwnode_mdio.c
+++ b/drivers/net/mdio/fwnode_mdio.c
@@ -89,9 +89,6 @@ int fwnode_mdiobus_phy_device_register(struct mii_bus *mdio,
phy->irq = mdio->irq[addr];
}
- if (fwnode_property_read_bool(child, "broken-turn-around"))
- mdio->phy_ignore_ta_mask |= 1 << addr;
-
/* Associate the fwnode with the device structure so it
* can be looked up later
*/
diff --git a/drivers/net/mdio/of_mdio.c b/drivers/net/mdio/of_mdio.c
index b8d298c04d3f..c03fcf34b3a6 100644
--- a/drivers/net/mdio/of_mdio.c
+++ b/drivers/net/mdio/of_mdio.c
@@ -46,6 +46,9 @@ EXPORT_SYMBOL(of_mdiobus_phy_device_register);
static int of_mdiobus_register_phy(struct mii_bus *mdio,
struct device_node *child, u32 addr)
{
+ if (of_property_read_bool(child, "broken-turn-around"))
+ mdio->phy_ignore_ta_mask |= BIT(addr);
+
return fwnode_mdiobus_register_phy(mdio, of_fwnode_handle(child), addr);
}
@@ -56,6 +59,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);
reply other threads:[~2026-11-21 9:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261121092933.186731-1-bage@debian.org \
--to=bage@debian.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.