[PATCH net] net: stmmac: platform: guarantee uniqueness of bus_id

Paolo Abeni pabeni at redhat.com
Mon May 26 13:26:47 PDT 2025


On 5/21/25 5:21 PM, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz at cherry.de>
> 
> bus_id is currently derived from the ethernetX alias. If one is missing
> for the device, 0 is used. If ethernet0 points to another stmmac device
> or if there are 2+ stmmac devices without an ethernet alias, then bus_id
> will be 0 for all of those.
> 
> This is an issue because the bus_id is used to generate the mdio bus id
> (new_bus->id in drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
> stmmac_mdio_register) and this needs to be unique.
> 
> This allows to avoid needing to define ethernet aliases for devices with
> multiple stmmac controllers (such as the Rockchip RK3588) for multiple
> stmmac devices to probe properly.
> 
> Obviously, the bus_id isn't guaranteed to be stable across reboots if no
> alias is set for the device but that is easily fixed by simply adding an
> alias if this is desired.
> 
> Signed-off-by: Quentin Schulz <quentin.schulz at cherry.de>

I think no need to CC stable here, but you need to provide a suitable
fixes tag, thanks!

Paolo




More information about the linux-arm-kernel mailing list