Skip to content

Commit f060db9

Browse files
justin-hedjbw
authored andcommitted
ACPI: NFIT: Use fallback node id when numa info in NFIT table is incorrect
When ACPI NFIT table is failing to populate correct numa information on arm64, dax_kmem will get NUMA_NO_NODE from the NFIT driver. Without this patch, pmem can't be probed as RAM devices on arm64 guest: $ndctl create-namespace -fe namespace0.0 --mode=devdax --map=dev -s 1g -a 128M kmem dax0.0: rejecting DAX region [mem 0x240400000-0x2bfffffff] with invalid node: -1 kmem: probe of dax0.0 failed with error -22 Suggested-by: Dan Williams <[email protected]> Signed-off-by: Jia He <[email protected]> Cc: <[email protected]> Fixes: c221c0b ("device-dax: "Hotplug" persistent memory for use like normal RAM") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dan Williams <[email protected]>
1 parent 5816b3e commit f060db9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/acpi/nfit/core.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3007,6 +3007,18 @@ static int acpi_nfit_register_region(struct acpi_nfit_desc *acpi_desc,
30073007
ndr_desc->target_node = NUMA_NO_NODE;
30083008
}
30093009

3010+
/* Fallback to address based numa information if node lookup failed */
3011+
if (ndr_desc->numa_node == NUMA_NO_NODE) {
3012+
ndr_desc->numa_node = memory_add_physaddr_to_nid(spa->address);
3013+
dev_info(acpi_desc->dev, "changing numa node from %d to %d for nfit region [%pa-%pa]",
3014+
NUMA_NO_NODE, ndr_desc->numa_node, &res.start, &res.end);
3015+
}
3016+
if (ndr_desc->target_node == NUMA_NO_NODE) {
3017+
ndr_desc->target_node = phys_to_target_node(spa->address);
3018+
dev_info(acpi_desc->dev, "changing target node from %d to %d for nfit region [%pa-%pa]",
3019+
NUMA_NO_NODE, ndr_desc->numa_node, &res.start, &res.end);
3020+
}
3021+
30103022
/*
30113023
* Persistence domain bits are hierarchical, if
30123024
* ACPI_NFIT_CAPABILITY_CACHE_FLUSH is set then

0 commit comments

Comments
 (0)