Skip to content

Commit f0c5d3b

Browse files
committed
cxl: Adjust extended linear cache failure emission in cxl_acpi
The cxl_acpi module spams "Extended linear cache calculation failed" when the hmat memory target is not found for a node. This is normal when the memory target does not contain extended linear cache attributes. Adjust cxl_acpi_set_cache_size() to just return 0 if error is returned from hmat_get_extended_linear_cache_size(). That is the only error returned from hmat_get_extended_linear_cache_size() as -ENOENT. Also remove the check for -EOPNOTSUPP in cxl_setup_extended_linear_cache() since that errno is never returned by cxl_acpi_set_cache_size(). [dj: Flipped minor return logic suggested by Jonathan ] Suggested-by: Dan Williams <dan.j.williams@intel.com> Reviewed-by: Alison Schofield <alison.schofield@intel.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Link: https://patch.msgid.link/20251003185509.3215900-1-dave.jiang@intel.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
1 parent 6146a0f commit f0c5d3b

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

drivers/cxl/acpi.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ static int cxl_acpi_set_cache_size(struct cxl_root_decoder *cxlrd)
353353

354354
rc = hmat_get_extended_linear_cache_size(&res, nid, &cache_size);
355355
if (rc)
356-
return rc;
356+
return 0;
357357

358358
/*
359359
* The cache range is expected to be within the CFMWS.
@@ -378,21 +378,18 @@ static void cxl_setup_extended_linear_cache(struct cxl_root_decoder *cxlrd)
378378
int rc;
379379

380380
rc = cxl_acpi_set_cache_size(cxlrd);
381-
if (!rc)
382-
return;
383-
384-
if (rc != -EOPNOTSUPP) {
381+
if (rc) {
385382
/*
386-
* Failing to support extended linear cache region resize does not
383+
* Failing to retrieve extended linear cache region resize does not
387384
* prevent the region from functioning. Only causes cxl list showing
388385
* incorrect region size.
389386
*/
390387
dev_warn(cxlrd->cxlsd.cxld.dev.parent,
391-
"Extended linear cache calculation failed rc:%d\n", rc);
392-
}
388+
"Extended linear cache retrieval failed rc:%d\n", rc);
393389

394-
/* Ignoring return code */
395-
cxlrd->cache_size = 0;
390+
/* Ignoring return code */
391+
cxlrd->cache_size = 0;
392+
}
396393
}
397394

398395
DEFINE_FREE(put_cxlrd, struct cxl_root_decoder *,

0 commit comments

Comments
 (0)