linux_dsm_epyc7002/drivers/net/ethernet/mellanox/mlxsw
Vadim Pasternak 36844c855b mlxsw: core: Add validation of hardware device types for MGPIR register
When reading the number of gearboxes from the hardware, the driver does
not validate the returned 'device type' field. The driver can therefore
wrongly assume that the queried devices are gearboxes.

On Spectrum-3 systems that support different types of devices, this can
prevent the driver from loading, as it will try to query the
temperature sensors from devices which it assumes are gearboxes and in
fact are not.

For example:
[  218.129230] mlxsw_minimal 2-0048: Reg cmd access status failed (status=7(bad parameter))
[  218.138282] mlxsw_minimal 2-0048: Reg cmd access failed (reg_id=900a(mtmp),type=write)
[  218.147131] mlxsw_minimal 2-0048: Failed to setup temp sensor number 256
[  218.534480] mlxsw_minimal 2-0048: Fail to register core bus
[  218.540714] mlxsw_minimal: probe of 2-0048 failed with error -5

Fix this by validating the 'device type' field.

Fixes: 2e265a8b6c ("mlxsw: core: Extend hwmon interface with inter-connect temperature attributes")
Fixes: f14f4e621b ("mlxsw: core: Extend thermal core with per inter-connect device thermal zones")
Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-07 18:47:01 +01:00
..
cmd.h mlxsw: cmd: Free running clock PCI BAR and offsets via query firmware 2019-06-13 22:34:55 -07:00
core_acl_flex_actions.c
core_acl_flex_actions.h
core_acl_flex_keys.c mlxsw: spectrum_acl: Avoid size check for RX_ACL_SYSTEM_PORT element 2019-06-19 10:09:22 -04:00
core_acl_flex_keys.h mlxsw: spectrum_acl: Fix SRC_SYS_PORT element size 2019-06-19 10:09:22 -04:00
core_env.c mlxsw: core: Extend QSFP EEPROM size for ethtool 2019-10-22 10:30:41 -07:00
core_env.h
core_hwmon.c mlxsw: core: Add validation of hardware device types for MGPIR register 2020-02-07 18:47:01 +01:00
core_thermal.c mlxsw: core: Add validation of hardware device types for MGPIR register 2020-02-07 18:47:01 +01:00
core.c mlxsw: core: Add support for using EMAD string TLV 2019-11-12 10:54:02 -08:00
core.h mlxsw: core: Add support for using EMAD string TLV 2019-11-12 10:54:02 -08:00
emad.h mlxsw: core: Add EMAD string TLV 2019-11-12 10:54:02 -08:00
i2c.c mlxsw: Propagate extack down to register_fib_notifier() 2019-10-04 11:10:56 -07:00
i2c.h
ib.h
item.h
Kconfig mlxsw: spectrum: Extend to support Spectrum-3 ASIC 2019-08-08 22:27:09 -07:00
Makefile mlxsw: spectrum: Add devlink-trap support 2019-08-21 12:58:39 -07:00
minimal.c mlxsw: minimal: Fix an error handling path in 'mlxsw_m_port_create()' 2020-01-27 11:13:53 +01:00
pci_hw.h mlxsw: pci: Increase PCI reset timeout for SN3800 systems 2019-10-30 12:07:05 -07:00
pci.c mlxsw: Propagate extack down to register_fib_notifier() 2019-10-04 11:10:56 -07:00
pci.h mlxsw: spectrum: Extend to support Spectrum-3 ASIC 2019-08-08 22:27:09 -07:00
port.h mlxsw: spectrum: Use PMTM register to get max module width 2019-10-31 10:54:46 -07:00
reg.h mlxsw: reg: Increase MLXSW_REG_QEEC_MAS_DIS 2020-01-25 10:56:31 +01:00
resources.h mlxsw: spectrum: Introduce resource for getting offset of 4 lanes split port 2019-10-31 10:54:47 -07:00
spectrum1_acl_tcam.c
spectrum1_kvdl.c
spectrum1_mr_tcam.c
spectrum2_acl_tcam.c
spectrum2_kvdl.c
spectrum2_mr_tcam.c
spectrum_acl_atcam.c
spectrum_acl_bloom_filter.c
spectrum_acl_ctcam.c
spectrum_acl_erp.c
spectrum_acl_flex_actions.c
spectrum_acl_flex_actions.h
spectrum_acl_flex_keys.c mlxsw: spectrum_acl: Fix SRC_SYS_PORT element size 2019-06-19 10:09:22 -04:00
spectrum_acl_tcam.c
spectrum_acl_tcam.h
spectrum_acl.c mlxsw: spectrum_acl: Fix use-after-free during reload 2020-01-23 11:32:57 +01:00
spectrum_buffers.c mlxsw: Fix 64-bit division in mlxsw_sp_sb_prs_init 2019-10-31 13:55:34 -07:00
spectrum_cnt.c
spectrum_cnt.h
spectrum_dcb.c mlxsw: spectrum: Configure shaper rate and burst size together 2020-01-25 10:56:31 +01:00
spectrum_dpipe.c
spectrum_dpipe.h
spectrum_fid.c mlxsw: spectrum: Do not process learned records with a dummy FID 2019-07-17 15:19:46 -07:00
spectrum_flower.c mlxsw: spectrum_flower: Fail in case user specifies multiple mirror actions 2019-09-27 20:33:19 +02:00
spectrum_ipip.c mlxsw: Add ECN configurations with IPinIP tunnels 2020-01-19 16:23:52 +01:00
spectrum_ipip.h
spectrum_kvdl.c
spectrum_mr_tcam.c
spectrum_mr_tcam.h
spectrum_mr.c
spectrum_mr.h
spectrum_nve_vxlan.c mlxsw: spectrum_ptp: Increase parsing depth when PTP is enabled 2019-07-29 13:55:05 -07:00
spectrum_nve.c mlxsw: spectrum: Take devlink net instead of init_net 2019-10-04 11:10:56 -07:00
spectrum_nve.h mlxsw: spectrum_ptp: Increase parsing depth when PTP is enabled 2019-07-29 13:55:05 -07:00
spectrum_ptp.c mlxsw: spectrum: Push code getting port speed into a helper 2020-01-20 13:25:45 +01:00
spectrum_ptp.h mlxsw: spectrum_ptp: Add counters for GC events 2019-08-28 18:24:04 -07:00
spectrum_qdisc.c mlxsw: spectrum_qdisc: Fix 64-bit division error in mlxsw_sp_qdisc_tbf_rate_kbps 2020-01-31 08:52:41 -08:00
spectrum_router.c mlxsw: spectrum_router: Clear offload indication from IPv6 nexthops on abort 2020-02-07 18:47:01 +01:00
spectrum_router.h mlxsw: Add ECN configurations with IPinIP tunnels 2020-01-19 16:23:52 +01:00
spectrum_span.c spectrum: Add a delayed work to update SPAN buffsize according to speed 2020-01-20 13:25:46 +01:00
spectrum_span.h spectrum: Add a delayed work to update SPAN buffsize according to speed 2020-01-20 13:25:46 +01:00
spectrum_switchdev.c mlxsw: spectrum: Take devlink net instead of init_net 2019-10-04 11:10:56 -07:00
spectrum_switchdev.h
spectrum_trap.c mlxsw: Add OVERLAY_SMAC_MC trap 2020-01-19 16:23:52 +01:00
spectrum.c mlxsw: spectrum_qdisc: Support offloading of TBF Qdisc 2020-01-25 10:56:31 +01:00
spectrum.h mlxsw: spectrum_qdisc: Support offloading of TBF Qdisc 2020-01-25 10:56:31 +01:00
switchib.c mlxsw: Propagate extack down to register_fib_notifier() 2019-10-04 11:10:56 -07:00
switchx2.c mlxsw: switchx2: Do not modify cloned SKBs during xmit 2020-01-15 04:16:30 -08:00
trap.h mlxsw: Add OVERLAY_SMAC_MC trap 2020-01-19 16:23:52 +01:00
txheader.h