[PATCH net-next 0/6] mlxsw: Add support for new reset flow

Petr Machata
2023-03-22T16:50:58Z

Amit Cohen writes:

The driver resets the device during probe and during a devlink reload. The
current reset method reloads the current firmware version or a pending one,
if one was previously flashed using devlink. However, the reset does not
take down the PCI link, preventing the PCI firmware from being upgraded,
unless the system is rebooted.

To solve this problem, a new reset command was implemented in the firmware.
Unlike the current command, after issuing the new command the device will
not start the reset immediately, but only after the PCI link was disabled.

For Spectrum-4, the firmware will support the new reset flow, which
includes PCI reset. Add support for the new flow and use it only after
verifying it is supported by the current firmware version by querying the
Management Capabilities Mask (MCAM) register.

Patch set overview:
Patch #1 fixes a wrong order of registers' definitions.
Patches #2-#3 add the required registers and fields for new reset
support.
Patches #4-#5 prepare reset code to be extended.
Patch #6 adds support for the new reset flow.

Amit Cohen (6):
mlxsw: reg: Move 'mpsc' definition in 'mlxsw_reg_infos'
mlxsw: reg: Add Management Capabilities Mask Register
mlxsw: Extend MRSR pack() function to support new commands
mlxsw: pci: Rename mlxsw_pci_sw_reset()
mlxsw: pci: Move software reset code to a separate function
mlxsw: pci: Add support for new reset flow

drivers/net/ethernet/mellanox/mlxsw/pci.c | 169 ++++++++++++++++++-
drivers/net/ethernet/mellanox/mlxsw/pci_hw.h | 5 +
drivers/net/ethernet/mellanox/mlxsw/reg.h | 90 +++++++++-
3 files changed, 254 insertions(+), 10 deletions(-)

--
2.39.0