Skip to content

Commit c42a4d2

Browse files
Robert Richterdavejiang
authored andcommitted
cxl/acpi: Group xor arithmetric setup code in a single block
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>
1 parent 6123133 commit c42a4d2

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

drivers/cxl/acpi.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,6 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cfmws,
453453
ig = CXL_DECODER_MIN_GRANULARITY;
454454
cxld->interleave_granularity = ig;
455455

456-
cxl_setup_extended_linear_cache(cxlrd);
457-
458456
if (cfmws->interleave_arithmetic == ACPI_CEDT_CFMWS_ARITHMETIC_XOR) {
459457
if (ways != 1 && ways != 3) {
460458
cxims_ctx = (struct cxl_cxims_context) {
@@ -470,15 +468,14 @@ static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cfmws,
470468
return -EINVAL;
471469
}
472470
}
473-
}
474-
475-
cxlrd->qos_class = cfmws->qtg_id;
476-
477-
if (cfmws->interleave_arithmetic == ACPI_CEDT_CFMWS_ARITHMETIC_XOR) {
478471
cxlrd->ops.hpa_to_spa = cxl_apply_xor_maps;
479472
cxlrd->ops.spa_to_hpa = cxl_apply_xor_maps;
480473
}
481474

475+
cxl_setup_extended_linear_cache(cxlrd);
476+
477+
cxlrd->qos_class = cfmws->qtg_id;
478+
482479
rc = cxl_decoder_add(cxld);
483480
if (rc)
484481
return rc;

0 commit comments

Comments
 (0)