diff options
author | David S. Miller <davem@davemloft.net> | 2019-05-18 13:13:40 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-05-18 13:13:40 -0700 |
commit | ee8a2b95b737d5989efeb477d5a1ef5e6955b830 (patch) | |
tree | bec4eeb2158d856439ff0c065d652f399375065c /drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | |
parent | vsock/virtio: Initialize core virtio vsock before registering the driver (diff) | |
parent | mlxsw: core: Prevent reading unsupported slave address from SFP EEPROM (diff) | |
download | linux-dev-ee8a2b95b737d5989efeb477d5a1ef5e6955b830.tar.xz linux-dev-ee8a2b95b737d5989efeb477d5a1ef5e6955b830.zip |
Merge branch 'mlxsw-Two-port-module-fixes'
Ido Schimmel says:
====================
mlxsw: Two port module fixes
Patch #1 fixes driver initialization failure on old ASICs due to
unsupported register access. This is fixed by first testing if the
register is supported.
Patch #2 fixes reading of certain modules' EEPROM. The problem and
solution are explained in detail in the commit message.
Please consider both patches for stable.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/core_thermal.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c index 472f63f9fac5..d3e851e7ca72 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -740,6 +740,9 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core, struct mlxsw_thermal_module *module_tz; int i, err; + if (!mlxsw_core_res_query_enabled(core)) + return 0; + thermal->tz_module_arr = kcalloc(module_count, sizeof(*thermal->tz_module_arr), GFP_KERNEL); @@ -776,6 +779,9 @@ mlxsw_thermal_modules_fini(struct mlxsw_thermal *thermal) unsigned int module_count = mlxsw_core_max_ports(thermal->core); int i; + if (!mlxsw_core_res_query_enabled(thermal->core)) + return; + for (i = module_count - 1; i >= 0; i--) mlxsw_thermal_module_fini(&thermal->tz_module_arr[i]); kfree(thermal->tz_module_arr); |