ACPI: HMAT: Remove register of memory node for generic target
authorDave Jiang <dave.jiang@intel.com>
Fri, 8 Mar 2024 21:59:20 +0000 (14:59 -0700)
committerDan Williams <dan.j.williams@intel.com>
Tue, 12 Mar 2024 19:34:11 +0000 (12:34 -0700)
For generic targets, there's no reason to call
register_memory_node_under_compute_node() with the access levels that are
only visible to HMAT handling code. Only update the attributes and rename
hmat_register_generic_target_initiators() to hmat_update_generic_target().

The original call path ends up triggering register_memory_node_under_compute_node().
Although the access level would be "3" and not impact any current node arrays, it
introduces unwanted data into the numa node access_coordinate array.

Fixes: a3a3e341f169 ("acpi: numa: Add setting of generic port system locality attributes")
Cc: Rafael J. Wysocki <rafael@kernel.org>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Tested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/20240308220055.2172956-2-dave.jiang@intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/acpi/numa/hmat.c

index d6b85f0f6082f72421168b26fec4b2fff09b4e13..a26e7793ec4ef1a92ad7f34a75e7fc276b12bb78 100644 (file)
@@ -770,12 +770,12 @@ static void __hmat_register_target_initiators(struct memory_target *target,
        }
 }
 
-static void hmat_register_generic_target_initiators(struct memory_target *target)
+static void hmat_update_generic_target(struct memory_target *target)
 {
        static DECLARE_BITMAP(p_nodes, MAX_NUMNODES);
 
-       __hmat_register_target_initiators(target, p_nodes,
-                                         NODE_ACCESS_CLASS_GENPORT_SINK);
+       hmat_update_target_attrs(target, p_nodes,
+                                NODE_ACCESS_CLASS_GENPORT_SINK);
 }
 
 static void hmat_register_target_initiators(struct memory_target *target)
@@ -835,7 +835,7 @@ static void hmat_register_target(struct memory_target *target)
         */
        mutex_lock(&target_lock);
        if (*(u16 *)target->gen_port_device_handle) {
-               hmat_register_generic_target_initiators(target);
+               hmat_update_generic_target(target);
                target->registered = true;
        }
        mutex_unlock(&target_lock);