]> Gentwo Git Trees - linux/.git/commitdiff
cxl/acpi: Group xor arithmetric setup code in a single block
authorRobert Richter <rrichter@amd.com>
Fri, 14 Nov 2025 07:58:42 +0000 (08:58 +0100)
committerDave Jiang <dave.jiang@intel.com>
Fri, 14 Nov 2025 17:37:29 +0000 (10:37 -0700)
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>
Tested-by: Gregory Price <gourry@gourry.net>
Link: https://patch.msgid.link/20251114075844.1315805-3-rrichter@amd.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/cxl/acpi.c

index cef3e07244fd76908a97714be63a221440868abf..0a1bad3cafa767d9b8901bfc3470325b5c709d28 100644 (file)
@@ -453,8 +453,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) {
@@ -470,15 +468,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;