]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mlxsw: core_thermal: Extend internal structures to support multi thermal areas
authorVadim Pasternak <vadimp@nvidia.com>
Wed, 13 Apr 2022 15:17:30 +0000 (18:17 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Apr 2022 10:06:13 +0000 (11:06 +0100)
commitef0df4fa324af23a5b55d3518f5799c87b6b665a
treee0ffe266515cc7cdf7b5b2026edfa3f995918d49
parentfd27849dd6fd6913c35948653f8e167672655438
mlxsw: core_thermal: Extend internal structures to support multi thermal areas

Introduce intermediate level for thermal zones areas.
Currently all thermal zones are associated with thermal objects located
within the main board. Such objects are created during driver
initialization and removed during driver de-initialization.

For line cards in modular system the thermal zones are to be associated
with the specific line card. They should be created whenever new line
card is available (inserted, validated, powered and enabled) and
removed, when line card is getting unavailable.
The thermal objects found on the line card #n are accessed by setting
slot index to #n, while for access to objects found on the main board
slot index should be set to default value zero.

Each thermal area contains the set of thermal zones associated with
particular slot index.
Thus introduction of thermal zone areas allows to use the same APIs for
the main board and line cards, by adding slot index argument.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core_thermal.c