From: Jason Gunthorpe <jgg@nvidia.com>
To: Jian Wen <wenjianhn@gmail.com>
Cc: leonro@nvidia.com, Jian Wen <wenjian1@xiaomi.com>,
linux-rdma@vger.kernel.org
Subject: Re: [PATCH] RDMA/mlx5: Use mlx5_cmd_is_down to detect PCIe Surprise Link Down
Date: Thu, 9 Oct 2025 15:02:44 -0300 [thread overview]
Message-ID: <20251009180244.GC3899236@nvidia.com> (raw)
In-Reply-To: <20251009142326.3794769-1-wenjian1@xiaomi.com>
On Thu, Oct 09, 2025 at 10:23:20PM +0800, Jian Wen wrote:
> --- a/drivers/infiniband/hw/mlx5/umr.c
> +++ b/drivers/infiniband/hw/mlx5/umr.c
> @@ -254,7 +254,7 @@ static int mlx5r_umr_post_send(struct ib_qp *ibqp, u32 mkey, struct ib_cqe *cqe,
> unsigned int idx;
> int size, err;
>
> - if (unlikely(mdev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR))
> + if (unlikely(mlx5_cmd_is_down(mdev)))
> return -EIO;
I feel like this is just changing the race around..
The removal flow for the device is different if the HW is working than
if it isn't.
If it isn't working then the removal should disable and cancel all the
UMRs, using the umrc->lock. Otherwise there will be dead threads
floating around. It should also be setting
MLX5_DEVICE_STATE_INTERNAL_ERROR way at the start of removal.
So IDK, maybe check mlx5_cmd_is_down() and trigger the flow to
activate INTERNAL_ERROR befor doing anything else?
Jason
next prev parent reply other threads:[~2025-10-09 18:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-09 14:23 [PATCH] RDMA/mlx5: Use mlx5_cmd_is_down to detect PCIe Surprise Link Down Jian Wen
2025-10-09 17:49 ` Leon Romanovsky
2025-10-09 18:02 ` Jason Gunthorpe [this message]
2025-10-16 13:32 ` Maher Sanalla
[not found] ` <CAMXzGWKbt1+U6O2EUuzFRbbUc7Qx7Xy+2+1WCk5_OASejJN=JQ@mail.gmail.com>
2026-01-26 9:32 ` Maher Sanalla
2025-10-11 23:35 ` kernel test robot
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=20251009180244.GC3899236@nvidia.com \
--to=jgg@nvidia.com \
--cc=leonro@nvidia.com \
--cc=linux-rdma@vger.kernel.org \
--cc=wenjian1@xiaomi.com \
--cc=wenjianhn@gmail.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.