]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: core: Prevent duplication during QSFP module initialization
authorVadim Pasternak <vadimp@mellanox.com>
Tue, 12 Mar 2019 08:40:41 +0000 (08:40 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Mar 2019 21:55:16 +0000 (14:55 -0700)
commitdea38895b0dcfadf186b9ef88262ecc7a0ab6d50
tree0bf310e1a2a44858b4ebbaf5210c2aae0b232633
parent216cda5c0417e5d156655112461d8d27aef17c1d
mlxsw: core: Prevent duplication during QSFP module initialization

Verify during thermal initialization if QSFP module's entry is already
configured in order to prevent duplication.
Such scenario could happen in case two switch drivers (PCI and I2C
based) coexist and if after boot, splitting configuration is applied
for some ports and then I2C based driver is re-probed.
In such case after reboot same QSFP module, associated with split will
be discovered by I2C based driver few times, and it will cause a crash.

It could happen for example on system equipped with BMC (Baseboard
Management Controller), running I2C based driver, when the next steps
are performed:
- System boot
- Host side configures port spilt.
- BMC side is rebooted.

Fixes: 932907ee05ed ("mlxsw: core: Extend thermal module with per QSFP module thermal zones")
Signed-off-by: Vadim Pasternak <vadimp@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_thermal.c