All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Tony Battersby <tonyb@cybernetics.com>
Cc: Moshe Shemesh <moshe@nvidia.com>, linux-rdma@vger.kernel.org
Subject: Re: mlx5_ib fails probe with old firmware
Date: Tue, 13 Oct 2026 18:10:32 +0300	[thread overview]
Message-ID: <20261013151032.GS219304@unreal> (raw)
In-Reply-To: <45f66939-7cf2-47c1-950e-df0fc8d554c9@cybernetics.com>

On Tue, Oct 13, 2026 at 10:07:17AM -0400, Tony Battersby wrote:
> On 10/13/26 05:49, Moshe Shemesh wrote:
> >
> > On 10/9/2026 9:20 PM, Tony Battersby wrote:
> >> I have a number of Mellanox infiniband adapters out in the field with
> >> various firmware versions:
> >>
> >> lspci
> >> 01:00.0 Infiniband controller: Mellanox Technologies MT27600 [Connect-IB]
> >> Subsystem: Mellanox Technologies Device 0018
> >>
> >> lspci -n
> >> 01:00.0 0207: 15b3:1011
> >> Subsystem: 15b3:0018
> >>
> >> Ones with old firmware don't work:
> >>
> >> mlx5_core 0000:01:00.0: mlx5_pci_vsc_init:66:(pid 731): Failed to get valid vendor specific ID
> >> mlx5_core 0000:01:00.0: firmware version: 10.10.5020
> >> mlx5_core 0000:01:00.0: 63.008 Gb/s available PCIe bandwidth (8.0 GT/s PCIe x8 link)
> >> mlx5_core 0000:01:00.0: mlx5_cmd_out_err:810:(pid 731): QUERY_ISSI(0x10a) op_mod(0x0) failed, status bad system state(0x4), syndrome (0x408b33), err(-5)
> >> mlx5_core 0000:01:00.0: mlx5_core_set_issi:866:(pid 731): Query ISSI is not supported by FW, ISSI is 0
> >> mlx5_core 0000:01:00.0: mlx5_init_clock:1040:(pid 731): invalid device_frequency_khz, aborting HW clock init
> >> mlx5_core 0000:01:00.0: mlx5_cmd_out_err:810:(pid 731): QUERY_HCA_VPORT_CONTEXT(0x762) op_mod(0x0) failed, status bad operation(0x2), syndrome (0x3590f5), err(-22)
> >> infiniband mlx5_0: Couldn't create per-port data
> >> mlx5_ib.rdma: probe of mlx5_core.rdma.0 failed with error -12
> >>
> >> Ones with new firmware do work:
> >>
> >> mlx5_core 0000:01:00.0: firmware version: 10.12.780
> >> mlx5_core 0000:01:00.0: 63.008 Gb/s available PCIe bandwidth (8.0 GT/s PCIe x8 link)
> >> mlx5_core 0000:01:00.0: mlx5_init_clock:1614:(pid 755): invalid device_frequency_khz, aborting HW clock init
> >> mlx5_core 0000:01:00.0: Flow counters bulk query buffer size increased, bulk_query_len(1)
> >> mlx5_core 0000:01:00.0 mlx5_0: Port: 1 Link INIT
> >> mlx5_core 0000:01:00.0 mlx5_0: Port: 1 Link ACTIVE
> >>
> >> I can work around the problem with the following change:
> >>
> >> diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> >> index a457647edacd..4fc903c2a0be 100644
> >> --- a/drivers/infiniband/hw/mlx5/main.c
> >> +++ b/drivers/infiniband/hw/mlx5/main.c
> >> @@ -3611,7 +3611,7 @@ static int mlx5_port_immutable(struct ib_device *ibdev, u32 port_num,
> >>   
> >>                  err = mlx5_query_hca_vport_context(dev->mdev, 0, port_num, 0,
> >>                                                     &rep);
> >> -               if (err)
> >> +               if (0 && err)
> >>                          return err;
> >>          }
> >>
> >> This code was added in kernel 4.19 by commit b02289b3d60f ("RDMA:
> >> Validate grh_required when handling AVs").
> >>
> >> A similar problem was fixed in kernel 4.9 by commit f9c14e46748b
> >> ("net/mlx5: Fix query ISSI flow"), which is a source of some of the
> >> messages with the old firmware.
> >>
> >> Can anyone suggest a proper fix for this issue?  I can upgrade the
> >> firmware if necessary, but that would be less convenient than having a
> >> fix for the driver.
> > Hi Tony,
> > Thanks for your report.
> > Please try the following change:
> > diff --git a/drivers/infiniband/hw/mlx5/main.c 
> > b/drivers/infiniband/hw/mlx5/main.c
> > index a457647edacd..632a45f663f6 100644
> > --- a/drivers/infiniband/hw/mlx5/main.c
> > +++ b/drivers/infiniband/hw/mlx5/main.c
> > @@ -3605,7 +3605,8 @@ static int mlx5_port_immutable(struct ib_device 
> > *ibdev, u32 port_num,
> >          if (err)
> >                  return err;
> >
> > -       if (ll == IB_LINK_LAYER_INFINIBAND) {
> > +       if (ll == IB_LINK_LAYER_INFINIBAND &&
> > +           MLX5_CAP_GEN(dev->mdev, ib_virt)) {
> >                  if (ibdev->type == RDMA_DEVICE_TYPE_SMI)
> >                          port_num = smi_to_native_portnum(dev, port_num);
> >
> >
> >
> That does fix the problem with the old firmware.  However,
> the MLX5_CAP_GEN check triggers on both the old and new firmware (I
> added a printk to test). If that is intentional, then it looks good.
> 
> Tested-by: Tony Battersby <tonyb@cybernetics.com>

Thanks, Moshe will submit official patch.

> 
> 

      reply	other threads:[~2026-10-13 15:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09 18:20 mlx5_ib fails probe with old firmware Tony Battersby
2026-10-13  9:49 ` Moshe Shemesh
2026-10-13 14:07   ` Tony Battersby
2026-10-13 15:10     ` Leon Romanovsky [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261013151032.GS219304@unreal \
    --to=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=moshe@nvidia.com \
    --cc=tonyb@cybernetics.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.