Skip to content

Commit ce4995b

Browse files
daniellertsdavem330
authored andcommitted
mlxsw: spectrum: Allow driver to load with old firmware versions
The driver fails to load with old firmware versions that cannot report the maximum number of RIF MAC profiles [1]. Fix this by defaulting to a maximum of a single profile in such situations, as multiple profiles are not supported by old firmware versions. [1] mlxsw_spectrum 0000:03:00.0: cannot register bus device mlxsw_spectrum: probe of 0000:03:00.0 failed with error -5 Fixes: 1c375ff ("mlxsw: spectrum_router: Expose RIF MAC profiles to devlink resource") Signed-off-by: Danielle Ratson <[email protected]> Reported-by: Vadim Pasternak <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5789d04 commit ce4995b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/net/ethernet/mellanox/mlxsw/spectrum.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3290,10 +3290,10 @@ mlxsw_sp_resources_rif_mac_profile_register(struct mlxsw_core *mlxsw_core)
32903290
u8 max_rif_mac_profiles;
32913291

32923292
if (!MLXSW_CORE_RES_VALID(mlxsw_core, MAX_RIF_MAC_PROFILES))
3293-
return -EIO;
3294-
3295-
max_rif_mac_profiles = MLXSW_CORE_RES_GET(mlxsw_core,
3296-
MAX_RIF_MAC_PROFILES);
3293+
max_rif_mac_profiles = 1;
3294+
else
3295+
max_rif_mac_profiles = MLXSW_CORE_RES_GET(mlxsw_core,
3296+
MAX_RIF_MAC_PROFILES);
32973297
devlink_resource_size_params_init(&size_params, max_rif_mac_profiles,
32983298
max_rif_mac_profiles, 1,
32993299
DEVLINK_RESOURCE_UNIT_ENTRY);

0 commit comments

Comments
 (0)