From: Jonathan Cameron <jic23@kernel.org>
To: Alison Schofield <alison.schofield@intel.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
Dave Jiang <dave.jiang@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>,
Ira Weiny <iweiny@kernel.org>, Li Ming <ming.li@zohomail.com>,
Robert Richter <rrichter@amd.com>,
linux-cxl@vger.kernel.org,
Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Subject: Re: [PATCH v5 6/7] cxl/region: Support mixed-granularity user created regions
Date: Tue, 8 Sep 2026 01:03:24 +0100 [thread overview]
Message-ID: <20260908010324.519e0aa4@jic23-huawei> (raw)
In-Reply-To: <9929a7f5a2d8c05fe345252bef28c11fc36867c6.1788475206.git.alison.schofield@intel.com>
On Thu, 3 Sep 2026 16:23:48 -0700
Alison Schofield <alison.schofield@intel.com> wrote:
> User region creation currently requires an interleaving root to have the
> same granularity as the region.
>
> That rejects mixed-granularity layouts, those where the region granularity
> is finer than the granularity of the interleaving root decoder. A region
> granularity coarser than the root remains invalid because it produces
> incorrect DPA translations.
>
> Allow a region granularity finer than an interleaving root and continue to
> reject a coarser granularity. Validate the complete ways/granularity
> relationship when the region endpoints are attached.
>
> For example, CXL 4.0 Section 9.13.1.1 Table 9-7 describes a 6-way region at
> IGB across three host bridges as a 3-way root interleave at 2 * IGB with a
> 2-way interleave at IGB below it.
>
> Signed-off-by: Alison Schofield <alison.schofield@intel.com>
> Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Follow on for earlier comment. Not important though.
> ---
> drivers/cxl/core/region.c | 15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> index 5b7104a55fdd..374d8c2c32d1 100644
> --- a/drivers/cxl/core/region.c
> +++ b/drivers/cxl/core/region.c
> @@ -572,16 +572,13 @@ static int set_interleave_granularity(struct cxl_region *cxlr, int val)
> if (rc)
> return rc;
>
> - /*
> - * When the host-bridge is interleaved, disallow region granularity !=
> - * root granularity. Regions with a granularity less than the root
> - * interleave result in needing multiple endpoints to support a single
> - * slot in the interleave (possible to support in the future). Regions
> - * with a granularity greater than the root interleave result in invalid
> - * DPA translations (invalid to support).
> - */
> - if (cxld->interleave_ways > 1 && val != cxld->interleave_granularity)
> + /* Region granularity must not be coarser than an interleaving root's */
This is same as I raised earlier. To me the description of it the other way
around as any given decoder can't have granularity finer than the root is easier
to understand but meh, up to you.
> + if (cxld->interleave_ways > 1 && val > cxld->interleave_granularity) {
> + dev_dbg(&cxlr->dev,
> + "granularity %d exceeds root decoder granularity %d\n",
> + val, cxld->interleave_granularity);
> return -EINVAL;
> + }
>
> lockdep_assert_held_write(&cxl_rwsem.region);
>
next prev parent reply other threads:[~2026-09-08 0:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 23:23 [PATCH v5 0/7] cxl: Support mixed-granularity region interleaves Alison Schofield
2026-09-03 23:23 ` [PATCH v5 1/7] Documentation/cxl: Describe mixed-granularity regions Alison Schofield
2026-09-07 23:23 ` Jonathan Cameron
2026-09-03 23:23 ` [PATCH v5 2/7] cxl/region: Warn on user region position mismatch Alison Schofield
2026-09-03 23:23 ` [PATCH v5 3/7] cxl/region: Generalize endpoint position mapping Alison Schofield
2026-09-07 23:42 ` Jonathan Cameron
2026-09-03 23:23 ` [PATCH v5 4/7] cxl/region: Name the interleave locals in cxl_port_setup_targets() Alison Schofield
2026-09-07 23:50 ` [PATCH v5 4/7] cxo_ol/region: " Jonathan Cameron
2026-09-03 23:23 ` [PATCH v5 5/7] cxl/region: Support mixed-granularity auto regions Alison Schofield
2026-09-08 0:02 ` Jonathan Cameron
2026-09-03 23:23 ` [PATCH v5 6/7] cxl/region: Support mixed-granularity user created regions Alison Schofield
2026-09-08 0:03 ` Jonathan Cameron [this message]
2026-09-03 23:23 ` [PATCH v5 7/7] cxl/test: Add a topology to test mixed-granularity regions Alison Schofield
2026-09-08 0:10 ` Jonathan Cameron
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=20260908010324.519e0aa4@jic23-huawei \
--to=jic23@kernel.org \
--cc=alison.schofield@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=iweiny@kernel.org \
--cc=jonathan.cameron@oss.qualcomm.com \
--cc=linux-cxl@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 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.