From: sashiko-bot@kernel.org
To: "Richard Cheng" <icheng@nvidia.com>
Cc: linux-cxl@vger.kernel.org
Subject: Re: [PATCH v7 1/2] cxl/hdm: Allow zero sized HDM decoders
Date: Wed, 08 Jul 2026 10:54:18 +0000 [thread overview]
Message-ID: <20260708105418.DB7081F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260708104024.68029-2-icheng@nvidia.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] cxl_dpa_free() early-exits for zero-size DPA reservations, permanently breaking the LIFO teardown constraint and runtime reconfiguration.
--
--- Patch [1]: [PATCH v7 1/2] cxl/hdm: Allow zero sized HDM decoders ---
commit 6f85fee709a80e6ce5f72e57edb7b3f3de0aa965
Author: Richard Cheng <icheng@nvidia.com>
cxl/hdm: Allow zero sized HDM decoders
This commit treats empty CXL HDM decoders as first-class entities by backing
them with a zero-sized kmalloc'd resource. This allows the OS to correctly
enumerate ports on systems where the BIOS commits zero-sized decoders.
> diff --git a/drivers/cxl/core/hdm.c b/drivers/cxl/core/hdm.c
> index 0c80b76a5f9b4..ccbab2e21f060 100644
> --- a/drivers/cxl/core/hdm.c
> +++ b/drivers/cxl/core/hdm.c
[ ... ]
> @@ -545,7 +569,7 @@ int cxl_dpa_free(struct cxl_endpoint_decoder *cxled)
> struct device *dev = &cxled->cxld.dev;
>
> guard(rwsem_write)(&cxl_rwsem.dpa);
> - if (!cxled->dpa_res)
> + if (cxled_empty(cxled))
> return 0;
[Severity: High]
Does this early return prevent zero-sized reservations from being correctly
released?
In __cxl_dpa_reserve(), a zero-sized decoder is backed by a dummy resource,
assigned to cxled->dpa_res, and port->hdm_end is incremented. However,
because cxled_empty() returns true when resource_size() is 0, cxl_dpa_free()
will return 0 here and skip the call to devm_cxl_dpa_release().
This appears to leave the dummy resource allocated and port->hdm_end stranded.
Since port->hdm_end is never decremented, will this permanently break the LIFO
teardown constraint for any subsequent attempts to free preceding decoders on
the port?
> if (cxled->cxld.region) {
> dev_dbg(dev, "decoder assigned to: %s\n",
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260708104024.68029-1-icheng@nvidia.com?part=1
next prev parent reply other threads:[~2026-07-08 10:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 10:40 [PATCH v7 0/2] Support zero-sized HDM decoders Richard Cheng
2026-07-08 10:40 ` [PATCH v7 1/2] cxl/hdm: Allow zero sized " Richard Cheng
2026-07-08 10:54 ` sashiko-bot [this message]
2026-07-08 10:40 ` [PATCH v7 2/2] tools/testing/cxl: Enable zero sized decoders under hb0 Richard Cheng
2026-07-08 18:35 ` Alison Schofield
2026-07-09 2:33 ` Richard Cheng
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=20260708105418.DB7081F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=icheng@nvidia.com \
--cc=linux-cxl@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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