]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: hwmon: Provide optimization for QSFP modules number detection
authorVadim Pasternak <vadimp@mellanox.com>
Sun, 6 Oct 2019 06:34:49 +0000 (09:34 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 6 Oct 2019 16:31:39 +0000 (18:31 +0200)
commitf9445d3866c32e31e0225b0be66f9a890fdceaeb
tree5f183155be214c17f480678b8ccb776268fbd856
parentd18eb3d32c93f4f35afd0ba9999a53a2e2eff794
mlxsw: hwmon: Provide optimization for QSFP modules number detection

Use new field "num_of_modules" of MGPIR register for "hwmon" interface
in order to get the number of modules supported by system directly from
the system configuration, instead of getting it from port to module
mapping info.

Reading this info through MGPIR register is faster and does not depend
on possible dynamic re-configuration of ports.
In case of port dynamic re-configuration some modules can logically
"disappear" as a result of port split and un-spilt operations, which
can cause missing of some modules, in case this info is taken from port
to module mapping info.

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>
drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c