Skip to content

Commit 773501d

Browse files
idoschkuba-moo
authored andcommitted
mlxsw: pci: Fix driver initialization with old firmware
The driver queries the Management Capabilities Mask (MCAM) register during initialization to understand if a new and deeper reset flow is supported. However, not all firmware versions support this register, leading to the driver failing to load. Fix by treating an error in the register query as an indication that the feature is not supported. Fixes: f257c73 ("mlxsw: pci: Add support for new reset flow") Reported-by: Tim 'mithro' Ansell <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Petr Machata <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Kalesh AP <[email protected]> Signed-off-by: Petr Machata <[email protected]> Link: https://lore.kernel.org/r/ee968c49d53bac96a4c66d1b09ebbd097d81aca5.1713446092.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 7e2050a commit 773501d

File tree

1 file changed

+4
-6
lines changed
  • drivers/net/ethernet/mellanox/mlxsw

1 file changed

+4
-6
lines changed

drivers/net/ethernet/mellanox/mlxsw/pci.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,7 @@ mlxsw_pci_reset(struct mlxsw_pci *mlxsw_pci, const struct pci_device_id *id)
15301530
{
15311531
struct pci_dev *pdev = mlxsw_pci->pdev;
15321532
char mcam_pl[MLXSW_REG_MCAM_LEN];
1533-
bool pci_reset_supported;
1533+
bool pci_reset_supported = false;
15341534
u32 sys_status;
15351535
int err;
15361536

@@ -1548,11 +1548,9 @@ mlxsw_pci_reset(struct mlxsw_pci *mlxsw_pci, const struct pci_device_id *id)
15481548
mlxsw_reg_mcam_pack(mcam_pl,
15491549
MLXSW_REG_MCAM_FEATURE_GROUP_ENHANCED_FEATURES);
15501550
err = mlxsw_reg_query(mlxsw_pci->core, MLXSW_REG(mcam), mcam_pl);
1551-
if (err)
1552-
return err;
1553-
1554-
mlxsw_reg_mcam_unpack(mcam_pl, MLXSW_REG_MCAM_PCI_RESET,
1555-
&pci_reset_supported);
1551+
if (!err)
1552+
mlxsw_reg_mcam_unpack(mcam_pl, MLXSW_REG_MCAM_PCI_RESET,
1553+
&pci_reset_supported);
15561554

15571555
if (pci_reset_supported) {
15581556
pci_dbg(pdev, "Starting PCI reset flow\n");

0 commit comments

Comments
 (0)