From: Jason Gunthorpe <jgg@ziepe.ca>
To: Shifeng Li <lishifeng@sangfor.com.cn>
Cc: leon@kernel.org, wenglianfa@huawei.com, gustavoars@kernel.org,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
Shifeng Li <lishifeng1992@126.com>,
"Ding, Hui" <dinghui@sangfor.com.cn>
Subject: Re: [PATCH] RDMA/device: Fix a race between mad_client and cm_client init
Date: Thu, 4 Jan 2024 08:37:28 -0400 [thread overview]
Message-ID: <20240104123728.GC50608@ziepe.ca> (raw)
In-Reply-To: <80cac9fd-7fed-403e-8889-78e2fc7a49b0@sangfor.com.cn>
On Thu, Jan 04, 2024 at 02:48:14PM +0800, Shifeng Li wrote:
> The root cause is that mad_client and cm_client may init concurrently
> when devices_rwsem write semaphore is downgraded in enable_device_and_get() like:
That can't be true, the module loader infrastructue ensures those two
things are sequential.
You are trying to say that the post-client fixup stuff will still see
the DEVICE_REGISTERED before it reaches the clients_rwsem lock?
That probably just says the clients_rwsem should be obtained before
changing the DEVICE_STATE too :\
Jason
next prev parent reply other threads:[~2024-01-04 12:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-02 3:43 [PATCH] RDMA/device: Fix a race between mad_client and cm_client init Shifeng Li
2024-01-02 8:58 ` Leon Romanovsky
2024-01-02 11:33 ` Shifeng Li
2024-01-02 11:58 ` Leon Romanovsky
2024-01-02 12:30 ` Shifeng Li
2024-01-03 18:48 ` Jason Gunthorpe
[not found] ` <80cac9fd-7fed-403e-8889-78e2fc7a49b0@sangfor.com.cn>
2024-01-04 12:37 ` Jason Gunthorpe [this message]
2024-01-05 8:15 ` Shifeng Li
2024-01-05 14:19 ` Jason Gunthorpe
2024-01-15 3:27 ` Shifeng Li
2024-01-06 2:12 ` Ding Hui
2024-01-15 13:47 ` Jason Gunthorpe
[not found] ` <354e2bf7-a8b4-629d-3d2d-35951a52e8bd@sangfor.com.cn>
2024-01-26 2:25 ` Shifeng Li
2024-02-01 0:04 ` Jason Gunthorpe
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=20240104123728.GC50608@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=dinghui@sangfor.com.cn \
--cc=gustavoars@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=lishifeng1992@126.com \
--cc=lishifeng@sangfor.com.cn \
--cc=wenglianfa@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox