[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240120192125.1340857-1-andrew@lunn.ch>
Date: Sat, 20 Jan 2024 20:21:25 +0100
From: Andrew Lunn <andrew@...n.ch>
To: netdev-maintainers <edumazet@...gle.com>,
<kuba@...nel.org>,
<pabeni@...hat.com>,
<davem@...emloft.net>
Cc: Vladimir Oltean <vladimir.oltean@....com>,
netdev <netdev@...r.kernel.org>,
Andrew Lunn <andrew@...n.ch>,
stable@...r.kernel.org,
Tim Menninger <tmenninger@...estorage.com>
Subject: [PATCH net v1] net: dsa: mv88e6xxx: Make unsupported C45 reads return 0xffff
When there is no device on the bus for a given address, the pull up
resistor on the data line results in the read returning 0xffff. The
phylib core code understands this when scanning for devices on the
bus, and a number of MDIO bus masters make use of this as a way to
indicate they cannot perform the read.
Make us of this as a minimal fix for stable where the mv88e6xxx
returns EOPNOTSUPP when the hardware does not support C45, but phylib
interprets this as a fatal error, which it should not be.
Cc: stable@...r.kernel.org
Reported-by: Tim Menninger <tmenninger@...estorage.com>
Fixes: 1a136ca2e089 ("net: mdio: scan bus based on bus capabilities for C22 and C45")
Fixes: da099a7fb13d ("net: phy: Remove probe_capabilities")
Signed-off-by: Andrew Lunn <andrew@...n.ch>
---
drivers/net/dsa/mv88e6xxx/chip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 383b3c4d6f59..614cabb5c1b0 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -3659,7 +3659,7 @@ static int mv88e6xxx_mdio_read_c45(struct mii_bus *bus, int phy, int devad,
int err;
if (!chip->info->ops->phy_read_c45)
- return -EOPNOTSUPP;
+ return 0xffff;
mv88e6xxx_reg_lock(chip);
err = chip->info->ops->phy_read_c45(chip, bus, phy, devad, reg, &val);
--
2.43.0
Powered by blists - more mailing lists