From: Jonathan Cameron <jic23@kernel.org>
To: Sungwoo Kim <iam@sung-woo.kim>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
Dave Jiang <dave.jiang@intel.com>,
Alison Schofield <alison.schofield@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Ira Weiny <ira.weiny@intel.com>, Dan Williams <djbw@kernel.org>,
Robert Richter <rrichter@amd.com>, Li Ming <ming.li@zohomail.com>,
Gregory Price <gourry@gourry.net>,
Ben Widawsky <bwidawsk@kernel.org>, Dave Tian <daveti@purdue.edu>,
linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 0/2] cxl/region: Fix race conditions in cxl region unregistration.
Date: Mon, 27 Apr 2026 13:51:32 +0100 [thread overview]
Message-ID: <20260427135132.0fa47b24@jic23-huawei> (raw)
In-Reply-To: <20260427032010.916681-2-iam@sung-woo.kim>
On Sun, 26 Apr 2026 23:20:07 -0400
Sungwoo Kim <iam@sung-woo.kim> wrote:
> This version mainly addresses Dave's comments and meaningful issues reported by Sashiko AI[1].
>
> Overview
> ========
> This patch series fixes race conditions in cxl region unregistration.
>
> devm_release_action() should be called once, otherwise, it warns about
> the second call. However, the current implementation has a race condition
> that allows multiple calls to devm_release_action(). The details are in
> each patch.
>
> To fix these, the first patch adds a new function that guarantees that
> devm_release_action() is called only once.
> Using this function, the second patch subsitutes the current use of
> devm_release_action() in cxl region with the new function.
>
> Change in v3
> ============
> Addressed Dave's comments:
> - Split and made this in a patch series.
> - Enhanced a commit log explaining why a workqueue is used in the first patch.
> - Added a context on how these issues were found and what impact was observed and how that effects a user in the second patch.
> Sashiko AI review fixes:
> - Fixed construct_region() as it also can race.
> - Used a driver's wq instead of system wq so unbinding can drain a work.
>
> [1] https://sashiko.dev/#/patchset/20260422045637.3048249-2-iam%40sung-woo.kim
>
> Earlier approach:
> v2: https://lore.kernel.org/linux-cxl/20260422045637.3048249-2-iam@sung-woo.kim/
> v1: https://lore.kernel.org/linux-cxl/20260308185958.2453707-2-iam@sung-woo.kim/
Looks fine to me - I'm not particular keen on delayed releasing as it
may end up with unordered tear down but I don't have a better idea.
Reviewed-by: Jonathan Cameron <jic23@kernel.org>
>
> Sungwoo Kim (2):
> cxl/region: serialize devm action removal via scheduled work
> cxl/region: Fix a race bug in delete_region_store()
>
> drivers/cxl/core/port.c | 6 +++++
> drivers/cxl/core/region.c | 47 ++++++++++++++++++++++++++++++++++-----
> drivers/cxl/cxl.h | 9 ++++++++
> 3 files changed, 57 insertions(+), 5 deletions(-)
>
next prev parent reply other threads:[~2026-04-27 12:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 3:20 [PATCH v3 0/2] cxl/region: Fix race conditions in cxl region unregistration Sungwoo Kim
2026-04-27 3:20 ` [PATCH v3 1/2] cxl/region: serialize devm action removal via scheduled work Sungwoo Kim
2026-04-27 17:27 ` Dave Jiang
2026-04-27 3:20 ` [PATCH v3 2/2] cxl/region: Fix a race bug in delete_region_store() Sungwoo Kim
2026-04-27 12:51 ` Jonathan Cameron [this message]
2026-04-27 17:42 ` [PATCH v3 0/2] cxl/region: Fix race conditions in cxl region unregistration Dave Jiang
2026-04-28 5:42 ` Sungwoo Kim
2026-04-28 19:04 ` Dave Jiang
2026-04-28 20:28 ` Sungwoo Kim
2026-04-28 22:33 ` Dave Jiang
2026-04-30 4:39 ` Sungwoo Kim
2026-04-30 16:00 ` Dave Jiang
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=20260427135132.0fa47b24@jic23-huawei \
--to=jic23@kernel.org \
--cc=alison.schofield@intel.com \
--cc=bwidawsk@kernel.org \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=daveti@purdue.edu \
--cc=djbw@kernel.org \
--cc=gourry@gourry.net \
--cc=iam@sung-woo.kim \
--cc=ira.weiny@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.li@zohomail.com \
--cc=rrichter@amd.com \
--cc=vishal.l.verma@intel.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