[PATCH 2/3] cxl/acpi: Group xor arithmetric setup code in a single block

Robert Richter posted 3 patches 2 months, 4 weeks ago
There is a newer version of this series
[PATCH 2/3] cxl/acpi: Group xor arithmetric setup code in a single block
Posted by Robert Richter 2 months, 4 weeks ago
Simplify the xor arithmetric setup code by grouping it in a single
block. No need to split the block for QoS setup.

It is safe to reorder the call of cxl_setup_extended_linear_cache()
because there are no dependencies.

Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Signed-off-by: Robert Richter <rrichter@amd.com>
---
v2: spell fix in descripton (Jonathan),
---
---
 drivers/cxl/acpi.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c
index fab736aa77dc..50c2987e0459 100644
--- a/drivers/cxl/acpi.c
+++ b/drivers/cxl/acpi.c
@@ -465,8 +465,6 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cfmws,
 		ig = CXL_DECODER_MIN_GRANULARITY;
 	cxld->interleave_granularity = ig;
 
-	cxl_setup_extended_linear_cache(cxlrd);
-
 	if (cfmws->interleave_arithmetic == ACPI_CEDT_CFMWS_ARITHMETIC_XOR) {
 		if (ways != 1 && ways != 3) {
 			cxims_ctx = (struct cxl_cxims_context) {
@@ -482,15 +480,14 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cfmws,
 				return -EINVAL;
 			}
 		}
-	}
-
-	cxlrd->qos_class = cfmws->qtg_id;
-
-	if (cfmws->interleave_arithmetic == ACPI_CEDT_CFMWS_ARITHMETIC_XOR) {
 		cxlrd->ops.hpa_to_spa = cxl_apply_xor_maps;
 		cxlrd->ops.spa_to_hpa = cxl_apply_xor_maps;
 	}
 
+	cxl_setup_extended_linear_cache(cxlrd);
+
+	cxlrd->qos_class = cfmws->qtg_id;
+
 	rc = cxl_decoder_add(cxld);
 	if (rc)
 		return rc;
-- 
2.47.3
Re: [PATCH 2/3] cxl/acpi: Group xor arithmetric setup code in a single block
Posted by Gregory Price 2 months, 4 weeks ago
On Wed, Nov 12, 2025 at 09:51:03PM +0100, Robert Richter wrote:
> Simplify the xor arithmetric setup code by grouping it in a single
> block. No need to split the block for QoS setup.
> 
> It is safe to reorder the call of cxl_setup_extended_linear_cache()
> because there are no dependencies.
> 
> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
> Signed-off-by: Robert Richter <rrichter@amd.com>

Signed-off-by: Gregory Price <gourry@gourry.net>
Re: [PATCH 2/3] cxl/acpi: Group xor arithmetric setup code in a single block
Posted by Gregory Price 2 months, 4 weeks ago
On Wed, Nov 12, 2025 at 05:36:55PM -0500, Gregory Price wrote:
> On Wed, Nov 12, 2025 at 09:51:03PM +0100, Robert Richter wrote:
> > Simplify the xor arithmetric setup code by grouping it in a single
> > block. No need to split the block for QoS setup.
> > 
> > It is safe to reorder the call of cxl_setup_extended_linear_cache()
> > because there are no dependencies.
> > 
> > Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
> > Signed-off-by: Robert Richter <rrichter@amd.com>
> 
> Signed-off-by: Gregory Price <gourry@gourry.net>
>

Sigh, sorry, hit the wrong macro, DJ please drop this SoB

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