Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: dsa: microchip: Make MDIO bus name unique

In configurations with 2 or more DSA clusters it will fail to allocate
unique MDIO bus names as only the switch ID is used, fix this by using
a combination of the tree ID and switch ID when needed

Signed-off-by: Jesse Van Gavere <jesse.vangavere@scioteq.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20241206204202.649912-1-jesse.vangavere@scioteq.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Jesse Van Gavere and committed by
Jakub Kicinski
ca785888 2d20773a

+5 -1
+5 -1
drivers/net/dsa/microchip/ksz_common.c
··· 2550 2550 bus->read = ksz_sw_mdio_read; 2551 2551 bus->write = ksz_sw_mdio_write; 2552 2552 bus->name = "ksz user smi"; 2553 - snprintf(bus->id, MII_BUS_ID_SIZE, "SMI-%d", ds->index); 2553 + if (ds->dst->index != 0) { 2554 + snprintf(bus->id, MII_BUS_ID_SIZE, "SMI-%d-%d", ds->dst->index, ds->index); 2555 + } else { 2556 + snprintf(bus->id, MII_BUS_ID_SIZE, "SMI-%d", ds->index); 2557 + } 2554 2558 } 2555 2559 2556 2560 ret = ksz_parse_dt_phy_config(dev, bus, mdio_np);