From: Alison Schofield <alison.schofield@intel.com>
To: Anisa Su <anisa.su887@gmail.com>
Cc: <linux-cxl@vger.kernel.org>, <nvdimm@lists.linux.dev>,
<linux-kernel@vger.kernel.org>, Dave Jiang <dave.jiang@intel.com>,
"Jonathan Cameron" <jic23@kernel.org>,
Fan Ni <nifan.cxl@gmail.com>, Li Ming <ming.li@zohomail.com>,
Vishal Verma <vishal.l.verma@intel.com>,
"Davidlohr Bueso" <dave@stgolabs.net>,
Ira Weiny <iweiny@kernel.org>,
Benjamin Cheatham <benjamin.cheatham@amd.com>,
Wonjae Lee <wj28.lee@samsung.com>,
Junhee Park <jh9934.park@samsung.com>,
Heesoo Kim <habil.kim@samsung.com>,
Anisa Su <anisa.su@samsung.com>
Subject: Re: [PATCH v12 7/8] cxl/core: Return endpoint decoder information from region search
Date: Mon, 3 Aug 2026 18:02:40 -0700 [thread overview]
Message-ID: <anE6MEdR8guvLEzM@aschofie-mobl2.lan> (raw)
In-Reply-To: <20260731084901.1512819-8-anisa.su@samsung.com>
On Fri, Jul 31, 2026 at 01:48:12AM -0700, Anisa Su wrote:
> From: Ira Weiny <iweiny@kernel.org>
>
> cxl_dpa_to_region() finds the region from a <DPA, device> tuple.
> The search involves finding the device endpoint decoder as well.
>
> Dynamic capacity extent processing uses the endpoint decoder HPA
> information to calculate the HPA offset. In addition, well behaved
> extents should be contained within an endpoint decoder.
>
> Return the endpoint decoder found to be used in subsequent DCD code.
Hi Anisa,
I realize this series is intentionally preparatory work for the next set,
and that's often a reasonable way to stage things. However, this patch
is an example of where splitting the work makes review harder because
the new interface is no longer paired with its first user. I also
realize this patch carries review tags from the earlier posting, but
those reviewers (me included ;)) were able to evaluate the API together
with its caller.
I went back and looked at the a v10 series where the caller is present,
and the callsite looks fine. But I don't think reviewers should need
to consult an earlier series to understand a new API, nor assume the
caller will remain unchanged by the time the next series is posted.
Can we either -
1. Drop this change from this prep series and introduce it together
with its first caller in the next series, or
2. Keep it here and but clearly document the API contract, that *cxled
is only valid when the returned cxlr is not NULL.
As presented, no caller requests cxled, so the intended API contract
cannot really be verified from this patch alone.
-- Alison
/BTW - I think other patches in this prep set carry similar issues
but this one popped for me because of the subject. I headed into
it thinking a quick ACK, but no luck.
>
> Signed-off-by: Ira Weiny <iweiny@kernel.org>
> Signed-off-by: Anisa Su <anisa.su@samsung.com>
> Tested-by: Wonjae Lee <wj28.lee@samsung.com>
> Tested-by: Junhee Park <jh9934.park@samsung.com>
> Tested-by: Heesoo Kim <habil.kim@samsung.com>
> Reviewed-by: Jonathan Cameron <jic23@kernel.org>
> Reviewed-by: Fan Ni <nifan.cxl@gmail.com>
> Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> Reviewed-by: Li Ming <ming.li@zohomail.com>
> Reviewed-by: Alison Schofield <alison.schofield@intel.com>
> ---
> drivers/cxl/core/core.h | 6 ++++--
> drivers/cxl/core/mbox.c | 2 +-
> drivers/cxl/core/memdev.c | 4 ++--
> drivers/cxl/core/region.c | 8 +++++++-
> 4 files changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/cxl/core/core.h b/drivers/cxl/core/core.h
> index 07555ae63859..e4bd220faa92 100644
> --- a/drivers/cxl/core/core.h
> +++ b/drivers/cxl/core/core.h
> @@ -47,7 +47,8 @@ int cxl_decoder_detach(struct cxl_region *cxlr,
> int cxl_region_init(void);
> void cxl_region_exit(void);
> int cxl_get_poison_by_endpoint(struct cxl_port *port);
> -struct cxl_region *cxl_dpa_to_region(const struct cxl_memdev *cxlmd, u64 dpa);
> +struct cxl_region *cxl_dpa_to_region(const struct cxl_memdev *cxlmd, u64 dpa,
> + struct cxl_endpoint_decoder **cxled);
> u64 cxl_dpa_to_hpa(struct cxl_region *cxlr, const struct cxl_memdev *cxlmd,
> u64 dpa);
> int devm_cxl_add_dax_region(struct cxl_region *cxlr);
> @@ -61,7 +62,8 @@ static inline u64 cxl_dpa_to_hpa(struct cxl_region *cxlr,
> return ULLONG_MAX;
> }
> static inline
> -struct cxl_region *cxl_dpa_to_region(const struct cxl_memdev *cxlmd, u64 dpa)
> +struct cxl_region *cxl_dpa_to_region(const struct cxl_memdev *cxlmd, u64 dpa,
> + struct cxl_endpoint_decoder **cxled)
> {
> return NULL;
> }
> diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
> index a6cdea9f4080..b18ea02ed2e6 100644
> --- a/drivers/cxl/core/mbox.c
> +++ b/drivers/cxl/core/mbox.c
> @@ -969,7 +969,7 @@ void cxl_event_trace_record(struct cxl_memdev *cxlmd,
> guard(rwsem_read)(&cxl_rwsem.dpa);
>
> dpa = le64_to_cpu(evt->media_hdr.phys_addr) & CXL_DPA_MASK;
> - cxlr = cxl_dpa_to_region(cxlmd, dpa);
> + cxlr = cxl_dpa_to_region(cxlmd, dpa, NULL);
> if (cxlr) {
> u64 cache_size = cxlr->params.cache_size;
>
> diff --git a/drivers/cxl/core/memdev.c b/drivers/cxl/core/memdev.c
> index 33a3d2e7b13a..1565a5cf0f32 100644
> --- a/drivers/cxl/core/memdev.c
> +++ b/drivers/cxl/core/memdev.c
> @@ -317,7 +317,7 @@ int cxl_inject_poison_locked(struct cxl_memdev *cxlmd, u64 dpa)
> if (rc)
> return rc;
>
> - cxlr = cxl_dpa_to_region(cxlmd, dpa);
> + cxlr = cxl_dpa_to_region(cxlmd, dpa, NULL);
> if (cxlr)
> dev_warn_once(cxl_mbox->host,
> "poison inject dpa:%#llx region: %s\n", dpa,
> @@ -386,7 +386,7 @@ int cxl_clear_poison_locked(struct cxl_memdev *cxlmd, u64 dpa)
> if (rc)
> return rc;
>
> - cxlr = cxl_dpa_to_region(cxlmd, dpa);
> + cxlr = cxl_dpa_to_region(cxlmd, dpa, NULL);
> if (cxlr)
> dev_warn_once(cxl_mbox->host,
> "poison clear dpa:%#llx region: %s\n", dpa,
> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> index 1e211542b6b6..ec5e5b7090cf 100644
> --- a/drivers/cxl/core/region.c
> +++ b/drivers/cxl/core/region.c
> @@ -3012,6 +3012,7 @@ int cxl_get_poison_by_endpoint(struct cxl_port *port)
> struct cxl_dpa_to_region_context {
> struct cxl_region *cxlr;
> u64 dpa;
> + struct cxl_endpoint_decoder *cxled;
> };
>
> static int __cxl_dpa_to_region(struct device *dev, void *arg)
> @@ -3045,11 +3046,13 @@ static int __cxl_dpa_to_region(struct device *dev, void *arg)
> dev_name(dev));
>
> ctx->cxlr = cxlr;
> + ctx->cxled = cxled;
>
> return 1;
> }
>
> -struct cxl_region *cxl_dpa_to_region(const struct cxl_memdev *cxlmd, u64 dpa)
> +struct cxl_region *cxl_dpa_to_region(const struct cxl_memdev *cxlmd, u64 dpa,
> + struct cxl_endpoint_decoder **cxled)
> {
> struct cxl_dpa_to_region_context ctx;
> struct cxl_port *port = cxlmd->endpoint;
> @@ -3063,6 +3066,9 @@ struct cxl_region *cxl_dpa_to_region(const struct cxl_memdev *cxlmd, u64 dpa)
> if (cxl_num_decoders_committed(port))
> device_for_each_child(&port->dev, &ctx, __cxl_dpa_to_region);
>
> + if (cxled)
> + *cxled = ctx.cxled;
> +
> return ctx.cxlr;
> }
>
> --
> 2.43.0
>
next prev parent reply other threads:[~2026-08-04 1:02 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-31 8:48 [PATCH v12 0/8] DCD Prep Series Anisa Su
2026-07-31 8:48 ` [PATCH v12 1/8] cxl/mbox: Flag support for Dynamic Capacity Devices (DCD) Anisa Su
2026-08-03 18:03 ` Dave Jiang
2026-08-03 21:30 ` Alison Schofield
2026-08-03 23:12 ` Jonathan Cameron
2026-08-04 15:45 ` Gregory Price
2026-08-04 15:45 ` Gregory Price
2026-08-04 18:10 ` Anisa Su
2026-08-04 16:55 ` Alison Schofield
2026-08-04 18:13 ` Anisa Su
2026-07-31 8:48 ` [PATCH v12 2/8] cxl/mem: Read dynamic capacity configuration from the device Anisa Su
2026-08-03 14:33 ` Richard Cheng
2026-08-03 22:11 ` Anisa Su
2026-08-03 21:52 ` Alison Schofield
2026-08-04 9:12 ` Anisa Su
2026-08-04 16:00 ` Gregory Price
2026-08-03 23:55 ` Jonathan Cameron
2026-08-04 9:54 ` Anisa Su
2026-07-31 8:48 ` [PATCH v12 3/8] cxl/cdat: Gather DSMAS data for DCD partitions Anisa Su
2026-08-03 22:56 ` Alison Schofield
2026-08-05 6:58 ` Anisa Su
2026-07-31 8:48 ` [PATCH v12 4/8] cxl/events: Split event msgnum configuration from irq setup Anisa Su
2026-08-03 23:01 ` Alison Schofield
2026-07-31 8:48 ` [PATCH v12 5/8] cxl/pci: Factor out interrupt policy check Anisa Su
2026-08-03 23:55 ` Alison Schofield
2026-07-31 8:48 ` [PATCH v12 6/8] cxl/mem: Configure dynamic capacity interrupts Anisa Su
2026-08-04 0:13 ` Jonathan Cameron
2026-08-04 0:34 ` Alison Schofield
2026-07-31 8:48 ` [PATCH v12 7/8] cxl/core: Return endpoint decoder information from region search Anisa Su
2026-08-04 1:02 ` Alison Schofield [this message]
2026-07-31 8:48 ` [PATCH v12 8/8] cxl/core: Enforce partition order/simplify partition calls Anisa Su
2026-08-04 0:16 ` Jonathan Cameron
2026-08-04 1:37 ` 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=anE6MEdR8guvLEzM@aschofie-mobl2.lan \
--to=alison.schofield@intel.com \
--cc=anisa.su887@gmail.com \
--cc=anisa.su@samsung.com \
--cc=benjamin.cheatham@amd.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=habil.kim@samsung.com \
--cc=iweiny@kernel.org \
--cc=jh9934.park@samsung.com \
--cc=jic23@kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.li@zohomail.com \
--cc=nifan.cxl@gmail.com \
--cc=nvdimm@lists.linux.dev \
--cc=vishal.l.verma@intel.com \
--cc=wj28.lee@samsung.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