Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+7 -10
+7 -10
drivers/cxl/acpi.c
··· 353 353 354 354 rc = hmat_get_extended_linear_cache_size(&res, nid, &cache_size); 355 355 if (rc) 356 - return rc; 356 + return 0; 357 357 358 358 /* 359 359 * The cache range is expected to be within the CFMWS. ··· 378 378 int rc; 379 379 380 380 rc = cxl_acpi_set_cache_size(cxlrd); 381 - if (!rc) 382 - return; 383 - 384 - if (rc != -EOPNOTSUPP) { 381 + if (rc) { 385 382 /* 386 - * Failing to support extended linear cache region resize does not 383 + * Failing to retrieve extended linear cache region resize does not 387 384 * prevent the region from functioning. Only causes cxl list showing 388 385 * incorrect region size. 389 386 */ 390 387 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); 393 389 394 - /* Ignoring return code */ 395 - cxlrd->cache_size = 0; 390 + /* Ignoring return code */ 391 + cxlrd->cache_size = 0; 392 + } 396 393 } 397 394 398 395 DEFINE_FREE(put_cxlrd, struct cxl_root_decoder *,