* [PATCH net-next] net: mdio: handle broken-turn-around for non-PHY MDIO devices
@ 2026-11-19 23:13 Bastian Germann
2026-11-20 0:33 ` Andrew Lunn
0 siblings, 1 reply; 6+ messages 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] 6+ messages in thread
* Re: [PATCH net-next] net: mdio: handle broken-turn-around for non-PHY MDIO devices
2026-11-19 23:13 [PATCH net-next] net: mdio: handle broken-turn-around for non-PHY MDIO devices Bastian Germann
@ 2026-11-20 0:33 ` Andrew Lunn
2026-11-20 21:40 ` Bastian Germann
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Lunn @ 2026-11-20 0:33 UTC (permalink / raw)
To: Bastian Germann
Cc: Heiner Kallweit, David S . Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Russell King, netdev, linux-kernel, Vladimir Oltean
On Fri, Nov 20, 2026 at 12:13:19AM +0100, Bastian Germann wrote:
> 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.
What switch is causing you problems?
I do wounder if the call in fwnode_mdiobus_phy_device_register()
should be hoisted up into of_mdiobus_register_device, were it would be
common for both PHYs and MDIO devices.
Andrew
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH net-next] net: mdio: handle broken-turn-around for non-PHY MDIO devices
2026-11-20 0:33 ` Andrew Lunn
@ 2026-11-20 21:40 ` Bastian Germann
2026-11-20 22:07 ` Andrew Lunn
0 siblings, 1 reply; 6+ messages in thread
From: Bastian Germann @ 2026-11-20 21:40 UTC (permalink / raw)
To: Andrew Lunn
Cc: Heiner Kallweit, David S . Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Russell King, netdev, linux-kernel, Vladimir Oltean
On 11/20/26 01:33, Andrew Lunn wrote:
> On Fri, Nov 20, 2026 at 12:13:19AM +0100, Bastian Germann wrote:
>> 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.
> What switch is causing you problems?
It is with mv88e6085.
I have just found that Nathan Rossi sent basically the same patch as
<20210217044443.1246392-1-nathan@nathanrossi.com>.
> I do wounder if the call in fwnode_mdiobus_phy_device_register()
> should be hoisted up into of_mdiobus_register_device, were it would be
> common for both PHYs and MDIO devices.
>
> Andrew
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] net: mdio: handle broken-turn-around for non-PHY MDIO devices
2026-11-20 21:40 ` Bastian Germann
@ 2026-11-20 22:07 ` Andrew Lunn
2026-11-20 22:44 ` Bastian Germann
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Lunn @ 2026-11-20 22:07 UTC (permalink / raw)
To: Bastian Germann
Cc: Heiner Kallweit, David S . Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Russell King, netdev, linux-kernel, Vladimir Oltean
On Fri, Nov 20, 2026 at 10:40:55PM +0100, Bastian Germann wrote:
> On 11/20/26 01:33, Andrew Lunn wrote:
> > On Fri, Nov 20, 2026 at 12:13:19AM +0100, Bastian Germann wrote:
> > > 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.
> > What switch is causing you problems?
>
> It is with mv88e6085.
>
> I have just found that Nathan Rossi sent basically the same patch as
> <20210217044443.1246392-1-nathan@nathanrossi.com>.
[Goes and find the thread]
Are you bit banging as well? Or do you have another MDIO bus
controller?
The point about the mv88e6085 using multiple addresses is valid. How
do you have the mv88e6085 configured?
Andrew
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] net: mdio: handle broken-turn-around for non-PHY MDIO devices
2026-11-20 22:07 ` Andrew Lunn
@ 2026-11-20 22:44 ` Bastian Germann
2026-11-20 23:09 ` Andrew Lunn
0 siblings, 1 reply; 6+ messages in thread
From: Bastian Germann @ 2026-11-20 22:44 UTC (permalink / raw)
To: Andrew Lunn
Cc: Heiner Kallweit, David S . Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Russell King, netdev, linux-kernel, Vladimir Oltean
On 11/20/26 23:07, Andrew Lunn wrote:
> On Fri, Nov 20, 2026 at 10:40:55PM +0100, Bastian Germann wrote:
>> On 11/20/26 01:33, Andrew Lunn wrote:
>>> On Fri, Nov 20, 2026 at 12:13:19AM +0100, Bastian Germann wrote:
>>>> 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.
>>> What switch is causing you problems?
>> It is with mv88e6085.
>>
>> I have just found that Nathan Rossi sent basically the same patch as
>> <20210217044443.1246392-1-nathan@nathanrossi.com>.
> [Goes and find the thread]
>
> Are you bit banging as well? Or do you have another MDIO bus
> controller?
>
> The point about the mv88e6085 using multiple addresses is valid. How
> do you have the mv88e6085 configured?
It is with the TI CPSW3G MDIO controller (ti,davinci_mdio, ti,cpsw-mdio).
As this is on a AM64x, errata i2329 applies and davinci_mdio runs with
bitbanging.
The mv88e6085 (88E6341) is configured in multi-chip/indirect mode at
reg = <1>.
It does not use multiple addresses.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next] net: mdio: handle broken-turn-around for non-PHY MDIO devices
2026-11-20 22:44 ` Bastian Germann
@ 2026-11-20 23:09 ` Andrew Lunn
0 siblings, 0 replies; 6+ messages in thread
From: Andrew Lunn @ 2026-11-20 23:09 UTC (permalink / raw)
To: Bastian Germann
Cc: Heiner Kallweit, David S . Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Russell King, netdev, linux-kernel, Vladimir Oltean
> It is with the TI CPSW3G MDIO controller (ti,davinci_mdio, ti,cpsw-mdio).
> As this is on a AM64x, errata i2329 applies and davinci_mdio runs with
> bitbanging.
>
> The mv88e6085 (88E6341) is configured in multi-chip/indirect mode at reg =
> <1>.
> It does not use multiple addresses.
O.K, that is good.
So the concept is sounds, it is just a question of if the parsing of
the property should be done once at a higher level, since it is
supposed to be a common property.
Andrew
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-11-20 23:09 UTC | newest]
Thread overview: 6+ messages (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
2026-11-20 0:33 ` Andrew Lunn
2026-11-20 21:40 ` Bastian Germann
2026-11-20 22:07 ` Andrew Lunn
2026-11-20 22:44 ` Bastian Germann
2026-11-20 23:09 ` Andrew Lunn
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®