Skip to content

Commit 585b40e

Browse files
lunnkuba-moo
authored andcommitted
net: dsa: mv88e6xxx: Fix failed probe due to unsupported C45 reads
Not all mv88e6xxx device support C45 read/write operations. Those which do not return -EOPNOTSUPP. However, when phylib scans the bus, it considers this fatal, and the probe of the MDIO bus fails, which in term causes the mv88e6xxx probe as a whole to fail. 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. C45 allows multiple devices to be supported at one address, so phylib will perform a few reads at each address, so although thought not the most efficient solution, it is a way to avoid fatal errors. Make use of this as a minimal fix for stable to fix the probing problems. Follow up patches will rework how C45 operates to make it similar to C22 which considers -ENODEV as a none-fatal, and swap mv88e6xxx to using this. Cc: [email protected] Fixes: 743a19e ("net: dsa: mv88e6xxx: Separate C22 and C45 transactions") Reported-by: Tim Menninger <[email protected]> Signed-off-by: Andrew Lunn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 5dee6d6 commit 585b40e

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/dsa/mv88e6xxx

1 file changed

+1
-1
lines changed

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3659,7 +3659,7 @@ static int mv88e6xxx_mdio_read_c45(struct mii_bus *bus, int phy, int devad,
36593659
int err;
36603660

36613661
if (!chip->info->ops->phy_read_c45)
3662-
return -EOPNOTSUPP;
3662+
return 0xffff;
36633663

36643664
mv88e6xxx_reg_lock(chip);
36653665
err = chip->info->ops->phy_read_c45(chip, bus, phy, devad, reg, &val);

0 commit comments

Comments
 (0)