[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAH-L+nNme442ST30dxGNm0e41ZPqRWNmmNpbK_HjJc0fLXw=VA@mail.gmail.com>
Date: Wed, 17 Apr 2024 09:48:58 +0530
From: Kalesh Anakkur Purayil <kalesh-anakkur.purayil@...adcom.com>
To: Petr Machata <petrm@...dia.com>
Cc: "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
Ido Schimmel <idosch@...dia.com>, mlxsw@...dia.com, "Tim 'mithro' Ansell" <me@...h.ro>
Subject: Re: [PATCH net 3/3] mlxsw: pci: Fix driver initialization with old firmware
On Tue, Apr 16, 2024 at 3:57 PM Petr Machata <petrm@...dia.com> wrote:
>
> From: Ido Schimmel <idosch@...dia.com>
>
> 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: f257c73e5356 ("mlxsw: pci: Add support for new reset flow")
> Reported-by: Tim 'mithro' Ansell <me@...h.ro>
> Signed-off-by: Ido Schimmel <idosch@...dia.com>
> Reviewed-by: Petr Machata <petrm@...dia.com>
> Signed-off-by: Petr Machata <petrm@...dia.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@...adcom.com>
> ---
> drivers/net/ethernet/mellanox/mlxsw/pci.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/pci.c b/drivers/net/ethernet/mellanox/mlxsw/pci.c
> index 4d617057af25..13fd067c39ed 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/pci.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/pci.c
> @@ -1545,7 +1545,7 @@ mlxsw_pci_reset(struct mlxsw_pci *mlxsw_pci, const struct pci_device_id *id)
> {
> struct pci_dev *pdev = mlxsw_pci->pdev;
> char mcam_pl[MLXSW_REG_MCAM_LEN];
> - bool pci_reset_supported;
> + bool pci_reset_supported = false;
> u32 sys_status;
> int err;
>
> @@ -1563,11 +1563,9 @@ mlxsw_pci_reset(struct mlxsw_pci *mlxsw_pci, const struct pci_device_id *id)
> mlxsw_reg_mcam_pack(mcam_pl,
> MLXSW_REG_MCAM_FEATURE_GROUP_ENHANCED_FEATURES);
> err = mlxsw_reg_query(mlxsw_pci->core, MLXSW_REG(mcam), mcam_pl);
> - if (err)
> - return err;
> -
> - mlxsw_reg_mcam_unpack(mcam_pl, MLXSW_REG_MCAM_PCI_RESET,
> - &pci_reset_supported);
> + if (!err)
> + mlxsw_reg_mcam_unpack(mcam_pl, MLXSW_REG_MCAM_PCI_RESET,
> + &pci_reset_supported);
>
> if (pci_reset_supported) {
> pci_dbg(pdev, "Starting PCI reset flow\n");
> --
> 2.43.0
>
>
--
Regards,
Kalesh A P
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4239 bytes)
Powered by blists - more mailing lists