Hello Keith
Several issues:
* We always get a memory_side_cache, even if nothing was found in ACPI.
You should at least ignore the cache if size==0?
* Your code seems to only work with a single level of cache, since
there's a single cache_attrs entry in each target structure.
* I was getting a section mismatch warning and a crash on PMEM node
hotplug until I applied the patch below.
WARNING: vmlinux.o(.text+0x47d3f7): Section mismatch in reference from the function hmat_callback() to the function .init.text:hmat_register_target()
The function hmat_callback() references
the function __init hmat_register_target().
This is often because hmat_callback lacks a __init
annotation or the annotation of hmat_register_target is wrong.
Thanks
Brice
acpi/hmat: hmat_register_target() isn't __init only
It's called during PMEM node hotplug with kmem dax driver.
Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
--- a/drivers/acpi/hmat/hmat.c
+++ b/drivers/acpi/hmat/hmat.c
@@ -598,7 +598,7 @@ static void hmat_register_target_perf(struct memory_target *target)
node_set_perf_attrs(mem_nid, &target->hmem_attrs, 0);
}
-static __init void hmat_register_target(struct memory_target *target)
+static void hmat_register_target(struct memory_target *target)
{
if (!node_online(pxm_to_node(target->memory_pxm)))
return;