• Vadim Pasternak's avatar
    mlxsw: core: Prevent duplication during QSFP module initialization · 6bab45b4
    Vadim Pasternak authored
    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: 6a79507c ("mlxsw: core: Extend thermal module with per QSFP module thermal zones")
    Signed-off-by: default avatarVadim Pasternak <vadimp@mellanox.com>
    Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    6bab45b4
core_thermal.c 24.1 KB