From: Gregory Price <gourry@gourry.net>
To: Alejandro Lucero Palau <alucerop@amd.com>
Cc: linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com, dave@stgolabs.net,
jonathan.cameron@huawei.com, dave.jiang@intel.com,
alison.schofield@intel.com, vishal.l.verma@intel.com,
ira.weiny@intel.com, dan.j.williams@intel.com
Subject: Re: [PATCH 1/2] cxl/region: fix region leak when attach_target fails in cxl_add_to_region
Date: Tue, 24 Feb 2026 20:42:20 -0500 [thread overview]
Message-ID: <aZ5TfEeqULEGXo4N@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <87347db6-6838-4a60-ad1c-037f526f16b6@amd.com>
On Tue, Feb 24, 2026 at 04:15:33PM +0000, Alejandro Lucero Palau wrote:
>
> On 2/21/26 05:17, Gregory Price wrote:
> > On Fri, Feb 20, 2026 at 11:30:12PM -0500, Gregory Price wrote:
> > > cxl_add_to_region() ignores the return value of attach_target(). When
> > > attach_target() fails (e.g. cxl_port_setup_targets() returns -ENXIO),
> > > the auto-discovered region remains registered with its HPA resource
> > > consumed but never reaches COMMIT state. Subsequent region creation
> > > attempts fail with -ENOSPC because the HPA range is already reserved.
> > >
> > > Track whether this call to cxl_add_to_region() created the region, and
> > > call drop_region() on attach_target() failure to unregister it and
> > > release the HPA resource. Pre-existing regions are left alone since
> > > other endpoints may already be attached.
> > >
> > > Signed-off-by: Gregory Price <gourry@gourry.net>
> > BAH - disregard this patch, it uses drop_region which is introduced by
> > Alejandro here:
> >
> > https://lore.kernel.org/linux-cxl/20260201155438.2664640-20-alejandro.lucero-palau@amd.com/
> >
> Feel free to add it to this series. I have started to send individual series
> as you know but the part changing the region creation will require more work
> than the already sent.
>
> About this fix, it looks good to me, although I have to admit I'm a bit lost
> after following the discussion Allison points to. If we want to keep the
> state of failure for forensics, not sure if the debugging/tracing or default
> error info in this case will be enough.
>
> In any case:
>
> Reviewed-by: Alejandro Lucero <alucerop@amd.com>
>
Yeah i don't quite follow the want to keep the objects around, it seems
to cause more issues than it solves - but then i also don't think this
is going to be a particularly common problem
~Gregory
next prev parent reply other threads:[~2026-02-25 1:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-21 4:30 [PATCH 1/2] cxl/region: fix region leak when attach_target fails in cxl_add_to_region Gregory Price
2026-02-21 4:30 ` [PATCH 2/2] cxl/region: skip default driver attach for memdev with attach callbacks Gregory Price
2026-02-21 5:17 ` [PATCH 1/2] cxl/region: fix region leak when attach_target fails in cxl_add_to_region Gregory Price
2026-02-24 16:15 ` Alejandro Lucero Palau
2026-02-25 1:42 ` Gregory Price [this message]
2026-02-21 10:36 ` kernel test robot
2026-02-21 11:49 ` kernel test robot
2026-02-21 11:53 ` kernel test robot
2026-02-23 19:48 ` Alison Schofield
2026-02-23 20:15 ` Gregory Price
2026-02-24 0:18 ` Alison Schofield
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=aZ5TfEeqULEGXo4N@gourry-fedora-PF4VCD3F \
--to=gourry@gourry.net \
--cc=alison.schofield@intel.com \
--cc=alucerop@amd.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=ira.weiny@intel.com \
--cc=jonathan.cameron@huawei.com \
--cc=kernel-team@meta.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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