public inbox for linux-cxl@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] cxl: Cleanup region_res_match_cxl_range() function
@ 2025-11-06 17:01 Dave Jiang
  2025-11-06 17:01 ` [PATCH 1/2] cxl: Rename region_res_match_cxl_range() to spa_maps_hpa() Dave Jiang
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Dave Jiang @ 2025-11-06 17:01 UTC (permalink / raw)
  To: linux-cxl
  Cc: dan.j.williams, dave, jonathan.cameron, alison.schofield,
	vishal.l.verma, ira.weiny

Small series rename and clean up comment of region_res_match_cxl_range().

Dave Jiang (2):
  cxl: Rename region_res_match_cxl_range() to spa_maps_hpa()
  cxl: Clarify comment in spa_maps_hpa()

 drivers/cxl/core/region.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)


base-commit: 6146a0f1dfae5d37442a9ddcba012add260bceb0
-- 
2.51.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] cxl: Rename region_res_match_cxl_range() to spa_maps_hpa()
  2025-11-06 17:01 [PATCH 0/2] cxl: Cleanup region_res_match_cxl_range() function Dave Jiang
@ 2025-11-06 17:01 ` Dave Jiang
  2025-11-06 17:06   ` Gregory Price
  2025-11-06 17:01 ` [PATCH 2/2] cxl: Clarify comment in spa_maps_hpa() Dave Jiang
  2025-11-12 23:00 ` [PATCH 0/2] cxl: Cleanup region_res_match_cxl_range() function Dave Jiang
  2 siblings, 1 reply; 8+ messages in thread
From: Dave Jiang @ 2025-11-06 17:01 UTC (permalink / raw)
  To: linux-cxl
  Cc: dan.j.williams, dave, jonathan.cameron, alison.schofield,
	vishal.l.verma, ira.weiny

The function name region_res_match_cxl_range() does not accurately
convey the operation of address comparison with cache size. Rename
to spa_maps_hpa() to provide a better function name.

Suggested-by: Dan Williams <dan.j.williams@intel.com>
Link: https://lore.kernel.org/linux-cxl/68eea19c7e67e_2f899100a8@dwillia2-mobl4.notmuch/
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
 drivers/cxl/core/region.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
index b06fee1978ba..302db75dc908 100644
--- a/drivers/cxl/core/region.c
+++ b/drivers/cxl/core/region.c
@@ -838,8 +838,8 @@ static int match_free_decoder(struct device *dev, const void *data)
 	return 1;
 }
 
-static bool region_res_match_cxl_range(const struct cxl_region_params *p,
-				       const struct range *range)
+static bool spa_maps_hpa(const struct cxl_region_params *p,
+			 const struct range *range)
 {
 	if (!p->res)
 		return false;
@@ -865,7 +865,7 @@ static int match_auto_decoder(struct device *dev, const void *data)
 	cxld = to_cxl_decoder(dev);
 	r = &cxld->hpa_range;
 
-	if (region_res_match_cxl_range(p, r))
+	if (spa_maps_hpa(p, r))
 		return 1;
 
 	return 0;
@@ -1465,7 +1465,7 @@ static int cxl_port_setup_targets(struct cxl_port *port,
 	if (test_bit(CXL_REGION_F_AUTO, &cxlr->flags)) {
 		if (cxld->interleave_ways != iw ||
 		    (iw > 1 && cxld->interleave_granularity != ig) ||
-		    !region_res_match_cxl_range(p, &cxld->hpa_range) ||
+		    !spa_maps_hpa(p, &cxld->hpa_range) ||
 		    ((cxld->flags & CXL_DECODER_F_ENABLE) == 0)) {
 			dev_err(&cxlr->dev,
 				"%s:%s %s expected iw: %d ig: %d %pr\n",
@@ -3398,7 +3398,7 @@ static int match_region_by_range(struct device *dev, const void *data)
 	p = &cxlr->params;
 
 	guard(rwsem_read)(&cxl_rwsem.region);
-	return region_res_match_cxl_range(p, r);
+	return spa_maps_hpa(p, r);
 }
 
 static int cxl_extended_linear_cache_resize(struct cxl_region *cxlr,
-- 
2.51.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] cxl: Clarify comment in spa_maps_hpa()
  2025-11-06 17:01 [PATCH 0/2] cxl: Cleanup region_res_match_cxl_range() function Dave Jiang
  2025-11-06 17:01 ` [PATCH 1/2] cxl: Rename region_res_match_cxl_range() to spa_maps_hpa() Dave Jiang
@ 2025-11-06 17:01 ` Dave Jiang
  2025-11-06 17:10   ` Gregory Price
  2025-11-12 23:00 ` [PATCH 0/2] cxl: Cleanup region_res_match_cxl_range() function Dave Jiang
  2 siblings, 1 reply; 8+ messages in thread
From: Dave Jiang @ 2025-11-06 17:01 UTC (permalink / raw)
  To: linux-cxl
  Cc: dan.j.williams, dave, jonathan.cameron, alison.schofield,
	vishal.l.verma, ira.weiny

Update the comment in spa_maps_hpa() to clearly convey the construction
of extended linear cache.

Suggested-by: Dan Williams <dan.j.williams@intel.com>
Link: https://lore.kernel.org/linux-cxl/68eea19c7e67e_2f899100a8@dwillia2-mobl4.notmuch/
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
 drivers/cxl/core/region.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
index 302db75dc908..a5906d8b6064 100644
--- a/drivers/cxl/core/region.c
+++ b/drivers/cxl/core/region.c
@@ -845,9 +845,9 @@ static bool spa_maps_hpa(const struct cxl_region_params *p,
 		return false;
 
 	/*
-	 * If an extended linear cache region then the CXL range is assumed
-	 * to be fronted by the DRAM range in current known implementation.
-	 * This assumption will be made until a variant implementation exists.
+	 * The extended linear cache region is constructed by a 1:1 ratio
+	 * where the SPA maps equal amounts of DRAM and CXL HPA capacity with
+	 * CXL decoders at the high end of the SPA range.
 	 */
 	return p->res->start + p->cache_size == range->start &&
 		p->res->end == range->end;
-- 
2.51.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] cxl: Rename region_res_match_cxl_range() to spa_maps_hpa()
  2025-11-06 17:01 ` [PATCH 1/2] cxl: Rename region_res_match_cxl_range() to spa_maps_hpa() Dave Jiang
@ 2025-11-06 17:06   ` Gregory Price
  2025-11-11 16:00     ` Jonathan Cameron
  0 siblings, 1 reply; 8+ messages in thread
From: Gregory Price @ 2025-11-06 17:06 UTC (permalink / raw)
  To: Dave Jiang
  Cc: linux-cxl, dan.j.williams, dave, jonathan.cameron,
	alison.schofield, vishal.l.verma, ira.weiny

On Thu, Nov 06, 2025 at 10:01:07AM -0700, Dave Jiang wrote:
> The function name region_res_match_cxl_range() does not accurately
> convey the operation of address comparison with cache size. Rename
> to spa_maps_hpa() to provide a better function name.
> 
> Suggested-by: Dan Williams <dan.j.williams@intel.com>
> Link: https://lore.kernel.org/linux-cxl/68eea19c7e67e_2f899100a8@dwillia2-mobl4.notmuch/
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>

My favorite kind of patch

Reviewed-by: Gregory Price <gourry@gourry.net>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] cxl: Clarify comment in spa_maps_hpa()
  2025-11-06 17:01 ` [PATCH 2/2] cxl: Clarify comment in spa_maps_hpa() Dave Jiang
@ 2025-11-06 17:10   ` Gregory Price
  2025-11-11 16:00     ` Jonathan Cameron
  0 siblings, 1 reply; 8+ messages in thread
From: Gregory Price @ 2025-11-06 17:10 UTC (permalink / raw)
  To: Dave Jiang
  Cc: linux-cxl, dan.j.williams, dave, jonathan.cameron,
	alison.schofield, vishal.l.verma, ira.weiny

On Thu, Nov 06, 2025 at 10:01:08AM -0700, Dave Jiang wrote:
> Update the comment in spa_maps_hpa() to clearly convey the construction
> of extended linear cache.
> 
> Suggested-by: Dan Williams <dan.j.williams@intel.com>
> Link: https://lore.kernel.org/linux-cxl/68eea19c7e67e_2f899100a8@dwillia2-mobl4.notmuch/
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>


Reviewed-by: Gregory Price <gourry@gourry.net>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] cxl: Rename region_res_match_cxl_range() to spa_maps_hpa()
  2025-11-06 17:06   ` Gregory Price
@ 2025-11-11 16:00     ` Jonathan Cameron
  0 siblings, 0 replies; 8+ messages in thread
From: Jonathan Cameron @ 2025-11-11 16:00 UTC (permalink / raw)
  To: Gregory Price
  Cc: Dave Jiang, linux-cxl, dan.j.williams, dave, alison.schofield,
	vishal.l.verma, ira.weiny

On Thu, 6 Nov 2025 12:06:49 -0500
Gregory Price <gourry@gourry.net> wrote:

> On Thu, Nov 06, 2025 at 10:01:07AM -0700, Dave Jiang wrote:
> > The function name region_res_match_cxl_range() does not accurately
> > convey the operation of address comparison with cache size. Rename
> > to spa_maps_hpa() to provide a better function name.
> > 
> > Suggested-by: Dan Williams <dan.j.williams@intel.com>
> > Link: https://lore.kernel.org/linux-cxl/68eea19c7e67e_2f899100a8@dwillia2-mobl4.notmuch/
> > Signed-off-by: Dave Jiang <dave.jiang@intel.com>  
> 
> My favorite kind of patch
> 
> Reviewed-by: Gregory Price <gourry@gourry.net>

I can never remember which is which between hpa and spa, so I'll just assume this
is the right way around.

Reviewed-by: Jonathan Cameron <jonathan.cameron@huwei.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] cxl: Clarify comment in spa_maps_hpa()
  2025-11-06 17:10   ` Gregory Price
@ 2025-11-11 16:00     ` Jonathan Cameron
  0 siblings, 0 replies; 8+ messages in thread
From: Jonathan Cameron @ 2025-11-11 16:00 UTC (permalink / raw)
  To: Gregory Price
  Cc: Dave Jiang, linux-cxl, dan.j.williams, dave, alison.schofield,
	vishal.l.verma, ira.weiny

On Thu, 6 Nov 2025 12:10:36 -0500
Gregory Price <gourry@gourry.net> wrote:

> On Thu, Nov 06, 2025 at 10:01:08AM -0700, Dave Jiang wrote:
> > Update the comment in spa_maps_hpa() to clearly convey the construction
> > of extended linear cache.
> > 
> > Suggested-by: Dan Williams <dan.j.williams@intel.com>
> > Link: https://lore.kernel.org/linux-cxl/68eea19c7e67e_2f899100a8@dwillia2-mobl4.notmuch/
> > Signed-off-by: Dave Jiang <dave.jiang@intel.com>  
> 
> 
> Reviewed-by: Gregory Price <gourry@gourry.net>
> 

Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/2] cxl: Cleanup region_res_match_cxl_range() function
  2025-11-06 17:01 [PATCH 0/2] cxl: Cleanup region_res_match_cxl_range() function Dave Jiang
  2025-11-06 17:01 ` [PATCH 1/2] cxl: Rename region_res_match_cxl_range() to spa_maps_hpa() Dave Jiang
  2025-11-06 17:01 ` [PATCH 2/2] cxl: Clarify comment in spa_maps_hpa() Dave Jiang
@ 2025-11-12 23:00 ` Dave Jiang
  2 siblings, 0 replies; 8+ messages in thread
From: Dave Jiang @ 2025-11-12 23:00 UTC (permalink / raw)
  To: linux-cxl
  Cc: dan.j.williams, dave, jonathan.cameron, alison.schofield,
	vishal.l.verma, ira.weiny



On 11/6/25 10:01 AM, Dave Jiang wrote:
> Small series rename and clean up comment of region_res_match_cxl_range().
> 
> Dave Jiang (2):
>   cxl: Rename region_res_match_cxl_range() to spa_maps_hpa()
>   cxl: Clarify comment in spa_maps_hpa()
> 
>  drivers/cxl/core/region.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> 
> base-commit: 6146a0f1dfae5d37442a9ddcba012add260bceb0

Applied to cxl/next
c43521b9db7f5ed481cfdfb04ad2e7fe0cb9dcf5
8d27dd0b219f00fc1e0548ae5008abd7bb350611



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-11-12 23:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-06 17:01 [PATCH 0/2] cxl: Cleanup region_res_match_cxl_range() function Dave Jiang
2025-11-06 17:01 ` [PATCH 1/2] cxl: Rename region_res_match_cxl_range() to spa_maps_hpa() Dave Jiang
2025-11-06 17:06   ` Gregory Price
2025-11-11 16:00     ` Jonathan Cameron
2025-11-06 17:01 ` [PATCH 2/2] cxl: Clarify comment in spa_maps_hpa() Dave Jiang
2025-11-06 17:10   ` Gregory Price
2025-11-11 16:00     ` Jonathan Cameron
2025-11-12 23:00 ` [PATCH 0/2] cxl: Cleanup region_res_match_cxl_range() function Dave Jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox