Skip to content

Commit 74d9c59

Browse files
AlisonSchofielddavejiang
authored andcommitted
cxl/region: Quiet some dev_warn()s in extended linear cache setup
Extended Linear Cache (ELC) setup code emits a dev_warn(), "Extended linear cache calculation failed." for issues found while setting up the ELC. For platforms without CONFIG_ACPI_HMAT, every auto region setup will emit the warning because the default !ACPI_HMAT return value is EOPNOTSUPP. Suppress it by skipping the warn for EOPNOTSUPP. Change the EOPNOTSUPP in the actual ELC failure path to ENXIO. Remove the check and enusing dev_warn() when region resource size is NULL. The endpoint decoders hpa_range used to create the resource is checked in init_hdm_decoder(), so it cannot be NULL here. For good measure, add the rc value to the dev_warn(). It will either be the -ENOENT returned by HMAT if the mem target is not found, or the -ENXIO from the region driver calculation. Reviewed-by: Li Ming <ming.li@zohomail.com> Signed-off-by: Alison Schofield <alison.schofield@intel.com> Link: https://patch.msgid.link/20250306213700.2606304-1-alison.schofield@intel.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
1 parent 962ac4c commit 74d9c59

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

drivers/cxl/core/region.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3235,13 +3235,10 @@ static int cxl_extended_linear_cache_resize(struct cxl_region *cxlr,
32353235
struct cxl_root_decoder *cxlrd = to_cxl_root_decoder(cxlr->dev.parent);
32363236
struct cxl_region_params *p = &cxlr->params;
32373237
int nid = phys_to_target_node(res->start);
3238-
resource_size_t size, cache_size, start;
3238+
resource_size_t size = resource_size(res);
3239+
resource_size_t cache_size, start;
32393240
int rc;
32403241

3241-
size = resource_size(res);
3242-
if (!size)
3243-
return -EINVAL;
3244-
32453242
rc = cxl_acpi_get_extended_linear_cache_size(res, nid, &cache_size);
32463243
if (rc)
32473244
return rc;
@@ -3253,7 +3250,7 @@ static int cxl_extended_linear_cache_resize(struct cxl_region *cxlr,
32533250
dev_warn(&cxlr->dev,
32543251
"Extended Linear Cache size %pa != CXL size %pa. No Support!",
32553252
&cache_size, &size);
3256-
return -EOPNOTSUPP;
3253+
return -ENXIO;
32573254
}
32583255

32593256
/*
@@ -3305,14 +3302,14 @@ static int __construct_region(struct cxl_region *cxlr,
33053302
dev_name(&cxlr->dev));
33063303

33073304
rc = cxl_extended_linear_cache_resize(cxlr, res);
3308-
if (rc) {
3305+
if (rc && rc != -EOPNOTSUPP) {
33093306
/*
33103307
* Failing to support extended linear cache region resize does not
33113308
* prevent the region from functioning. Only causes cxl list showing
33123309
* incorrect region size.
33133310
*/
33143311
dev_warn(cxlmd->dev.parent,
3315-
"Extended linear cache calculation failed.\n");
3312+
"Extended linear cache calculation failed rc:%d\n", rc);
33163313
}
33173314

33183315
rc = insert_resource(cxlrd->res, res);

0 commit comments

Comments
 (0)