]> Gentwo Git Trees - linux/.git/commitdiff
cxl: Adjust extended linear cache failure emission in cxl_acpi
authorDave Jiang <dave.jiang@intel.com>
Fri, 3 Oct 2025 18:55:09 +0000 (11:55 -0700)
committerDave Jiang <dave.jiang@intel.com>
Mon, 3 Nov 2025 16:28:59 +0000 (09:28 -0700)
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>
drivers/cxl/acpi.c

index bd2e282ca93a059f12ba96fdf2e30f4ddbbaddb9..e6f0e7d99fc965a950efb71f75149321d96eee3a 100644 (file)
@@ -353,7 +353,7 @@ static int cxl_acpi_set_cache_size(struct cxl_root_decoder *cxlrd)
 
        rc = hmat_get_extended_linear_cache_size(&res, nid, &cache_size);
        if (rc)
-               return rc;
+               return 0;
 
        /*
         * 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)
        int rc;
 
        rc = cxl_acpi_set_cache_size(cxlrd);
-       if (!rc)
-               return;
-
-       if (rc != -EOPNOTSUPP) {
+       if (rc) {
                /*
-                * Failing to support extended linear cache region resize does not
+                * Failing to retrieve extended linear cache region resize does not
                 * prevent the region from functioning. Only causes cxl list showing
                 * incorrect region size.
                 */
                dev_warn(cxlrd->cxlsd.cxld.dev.parent,
-                        "Extended linear cache calculation failed rc:%d\n", rc);
-       }
+                        "Extended linear cache retrieval failed rc:%d\n", rc);
 
-       /* Ignoring return code */
-       cxlrd->cache_size = 0;
+               /* Ignoring return code */
+               cxlrd->cache_size = 0;
+       }
 }
 
 DEFINE_FREE(put_cxlrd, struct cxl_root_decoder *,