* [PATCH net-next v2] net: dsa: microchip: Make MDIO bus name unique
@ 2024-11-28 21:25 Jesse Van Gavere
2024-11-29 14:54 ` Andrew Lunn
0 siblings, 1 reply; 4+ messages in thread
From: Jesse Van Gavere @ 2024-11-28 21:25 UTC (permalink / raw)
To: netdev, woojung.huh, UNGLinuxDriver, andrew, olteanv
Cc: davem, edumazet, kuba, pabeni, Jesse Van Gavere
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
Signed-off-by: Jesse Van Gavere <jesse.vangavere@scioteq.com>
---
Changes v2: target net-next, probably an improvement rather than a true bug
drivers/net/dsa/microchip/ksz_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index 920443ee8ffd..0d5dbbdd41f8 100644
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -2550,7 +2550,7 @@ static int ksz_mdio_register(struct ksz_device *dev)
bus->read = ksz_sw_mdio_read;
bus->write = ksz_sw_mdio_write;
bus->name = "ksz user smi";
- snprintf(bus->id, MII_BUS_ID_SIZE, "SMI-%d", ds->index);
+ snprintf(bus->id, MII_BUS_ID_SIZE, "SMI-%d-%d", ds->dst->index, ds->index);
}
ret = ksz_parse_dt_phy_config(dev, bus, mdio_np);
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next v2] net: dsa: microchip: Make MDIO bus name unique
2024-11-28 21:25 [PATCH net-next v2] net: dsa: microchip: Make MDIO bus name unique Jesse Van Gavere
@ 2024-11-29 14:54 ` Andrew Lunn
2024-12-03 5:31 ` Jesse Van Gavere
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2024-11-29 14:54 UTC (permalink / raw)
To: Jesse Van Gavere
Cc: netdev, woojung.huh, UNGLinuxDriver, olteanv, davem, edumazet,
kuba, pabeni, Jesse Van Gavere
On Thu, Nov 28, 2024 at 10:25:09PM +0100, Jesse Van Gavere wrote:
> 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
>
> Signed-off-by: Jesse Van Gavere <jesse.vangavere@scioteq.com>
> ---
> Changes v2: target net-next, probably an improvement rather than a true bug
net-next is closed at the moment due to the merge window. Please
repost once it opens.
This change is probably O.K, but we have to be a little bit careful
with the ABI. This name is visible in /sys/bus and udev events. In
theory somebody could have scripts which depend on this name. I doubt
such scripts actually exist, and if somebody reports a regression we
will need to revert this change, and do something different. You could
for example look at dst->index and use the two part name when it is
not zero, one part name when it is zero.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH net-next v2] net: dsa: microchip: Make MDIO bus name unique
2024-11-29 14:54 ` Andrew Lunn
@ 2024-12-03 5:31 ` Jesse Van Gavere
2024-12-04 1:10 ` Jakub Kicinski
0 siblings, 1 reply; 4+ messages in thread
From: Jesse Van Gavere @ 2024-12-03 5:31 UTC (permalink / raw)
To: Andrew Lunn
Cc: netdev, woojung.huh, UNGLinuxDriver, olteanv, davem, edumazet,
kuba, pabeni, Jesse Van Gavere
Hello Andrew,
Op vr 29 nov 2024 om 15:54 schreef Andrew Lunn <andrew@lunn.ch>:
>
> On Thu, Nov 28, 2024 at 10:25:09PM +0100, Jesse Van Gavere wrote:
> > 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
> >
> > Signed-off-by: Jesse Van Gavere <jesse.vangavere@scioteq.com>
> > ---
> > Changes v2: target net-next, probably an improvement rather than a true bug
>
> net-next is closed at the moment due to the merge window. Please
> repost once it opens.
>
> This change is probably O.K, but we have to be a little bit careful
> with the ABI. This name is visible in /sys/bus and udev events. In
> theory somebody could have scripts which depend on this name. I doubt
> such scripts actually exist, and if somebody reports a regression we
> will need to revert this change, and do something different. You could
> for example look at dst->index and use the two part name when it is
> not zero, one part name when it is zero.
I thought about that too and came to the same conclusion originally
that it's unlikely someone uses it, but you're right that it's better
to be safe than sorry and that sounds like a good workaround to that
potential problem, so I'll adjust that in the next version when the
merge window opens, my apologies for not sending at the correct time,
still getting the hang of contributing.
Best regards,
Jesse
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next v2] net: dsa: microchip: Make MDIO bus name unique
2024-12-03 5:31 ` Jesse Van Gavere
@ 2024-12-04 1:10 ` Jakub Kicinski
0 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2024-12-04 1:10 UTC (permalink / raw)
To: Jesse Van Gavere
Cc: Andrew Lunn, netdev, woojung.huh, UNGLinuxDriver, olteanv, davem,
edumazet, pabeni, Jesse Van Gavere
On Tue, 3 Dec 2024 06:31:45 +0100 Jesse Van Gavere wrote:
> I'll adjust that in the next version when the
> merge window opens, my apologies for not sending at the correct time,
> still getting the hang of contributing.
net-next is closed when merge window is open, they are in opposite
states. All that to say that net-next is open now, you can resend :)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-12-04 1:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-28 21:25 [PATCH net-next v2] net: dsa: microchip: Make MDIO bus name unique Jesse Van Gavere
2024-11-29 14:54 ` Andrew Lunn
2024-12-03 5:31 ` Jesse Van Gavere
2024-12-04 1:10 ` Jakub Kicinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).