From: sashiko-bot@kernel.org
To: "Alison Schofield" <alison.schofield@intel.com>
Cc: linux-cxl@vger.kernel.org
Subject: Re: [PATCH 1/2] cxl/region: Allow passthrough decoders with >16K granularity
Date: Thu, 11 Jun 2026 00:42:10 +0000 [thread overview]
Message-ID: <20260611004211.66A091F00893@smtp.kernel.org> (raw)
In-Reply-To: <e8cd395fc7cee8d126449db9d7fd8b37ddd43459.1781136281.git.alison.schofield@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Passthrough decoders in CXL_REGION_F_AUTO mode do not update their `interleave_granularity` to the logically computed `ig`, breaking auto-discovery for downstream interleaving decoders.
--
commit e8de72986281000607b505c71ee58ce7b4899cb6
Author: Alison Schofield <alison.schofield@intel.com>
Subject: cxl/region: Allow passthrough decoders with >16K granularity
This commit relaxes granularity validation for non-interleaving passthrough
decoders. It ensures the computed granularity is kept to seed descendant
decoder setups while programming a don't-care encoding when committing
non-interleaving decoders.
> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> --- a/drivers/cxl/core/region.c
> +++ b/drivers/cxl/core/region.c
[ ... ]
> @@ -1538,20 +1546,21 @@ static int cxl_port_setup_targets(struct cxl_port *port,
> * Interleave granularity is a multiple of @parent_port granularity.
> * Multiplier is the parent port interleave ways.
> */
> - rc = granularity_to_eig(parent_ig * parent_iw, &eig);
> - if (rc) {
> - dev_dbg(&cxlr->dev,
> - "%s: invalid granularity calculation (%d * %d)\n",
> - dev_name(&parent_port->dev), parent_ig, parent_iw);
> - return rc;
> - }
> + ig = parent_ig * parent_iw;
>
> - rc = eig_to_granularity(eig, &ig);
> - if (rc) {
> - dev_dbg(&cxlr->dev, "%s:%s: invalid interleave: %d\n",
> - dev_name(port->uport_dev), dev_name(&port->dev),
> - 256 << eig);
> - return rc;
> + /*
> + * Keep the computed granularity for descendant setup. Only
> + * interleaving decoders require an encodable granularity.
> + */
> + if (iw > 1) {
> + rc = granularity_to_eig(ig, &eig);
> + if (rc) {
> + dev_dbg(&cxlr->dev,
> + "%s: invalid granularity calculation (%d * %d)\n",
> + dev_name(&parent_port->dev), parent_ig,
> + parent_iw);
> + return rc;
> + }
> }
>
> if (iw > 8 || iw > cxlsd->nr_targets) {
[Severity: High]
This is a pre-existing issue, but since the commit message mentions keeping
the computed value for passthrough decoders to seed descendant setup, does
the auto-discovery path also need to be updated to ensure this?
During region auto-discovery (CXL_REGION_F_AUTO), cxl_port_setup_targets()
checks the configuration but does not appear to update the decoder's
interleave_granularity for passthrough decoders:
if (test_bit(CXL_REGION_F_AUTO, &cxlr->flags)) {
if (cxld->interleave_ways != iw ||
(iw > 1 && cxld->interleave_granularity != ig) ||
!spa_maps_hpa(p, &cxld->hpa_range) ||
((cxld->flags & CXL_DECODER_F_ENABLE) == 0)) {
// ... validation fails ...
return -ENXIO;
}
// cxld->interleave_granularity is not updated to ig here
} else {
// ... manual config path updates it:
cxld->interleave_granularity = ig;
}
Since cxld->interleave_granularity is never updated to the computed ig in
the auto-discovery block, it retains the hardware don't-care value (such as
256 bytes or 0) read from the register.
When a downstream switch decoder is subsequently evaluated, it loads this
unencodable hardware value as parent_ig. If the downstream decoder is
interleaving (iw > 1), it will calculate a logically incorrect ig from the
garbage parent_ig. This would cause it to fail its own validation and abort
region assembly with -ENXIO.
Should cxld->interleave_granularity be explicitly updated to ig in the
CXL_REGION_F_AUTO path to prevent downstream decoders from inheriting
unencodable don't-care values?
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1781136281.git.alison.schofield@intel.com?part=1
next prev parent reply other threads:[~2026-06-11 0:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-11 0:29 [PATCH 0/2] cxl: Allow passthrough decoders with >16K granularity Alison Schofield
2026-06-11 0:29 ` [PATCH 1/2] cxl/region: " Alison Schofield
2026-06-11 0:42 ` sashiko-bot [this message]
2026-06-11 0:29 ` [PATCH 2/2] cxl/test: Add a 2-way 16K root decoder for passthrough testing 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=20260611004211.66A091F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=alison.schofield@intel.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 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.