FAILED: patch "[PATCH] ACPI: NFIT: Use fallback node id when numa info in NFIT table" failed to apply to 5.4-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From f060db99374e80e853ac4916b49f0a903f65e9dc Mon Sep 17 00:00:00 2001
From: Jia He <[email protected]>
Date: Wed, 22 Sep 2021 23:29:19 +0800
Subject: [PATCH] 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
drivers/acpi/nfit/core.c +12 -0
@@ -3007,6 +3007,18 @@ static int acpi_nfit_register_region(struct acpi_nfit_desc *acpi_desc, ndr_desc->target_node =NUMA_NO_NODE ; } +/* Fallback to address based numa information if node lookup failed */ +if (ndr_desc->numa_node ==NUMA_NO_NODE ) { + ndr_desc->numa_node =memory_add_physaddr_to_nid (spa->address); +dev_info (acpi_desc->dev,"changing numa node from %d to %d for nfit region [%pa-%pa]" , +NUMA_NO_NODE , ndr_desc->numa_node, &res.start, &res.end); + } +if (ndr_desc->target_node ==NUMA_NO_NODE ) { + ndr_desc->target_node =phys_to_target_node (spa->address); +dev_info (acpi_desc->dev,"changing target node from %d to %d for nfit region [%pa-%pa]" , +NUMA_NO_NODE , ndr_desc->numa_node, &res.start, &res.end); + } +/* * Persistence domain bits are hierarchical, if * ACPI_NFIT_CAPABILITY_CACHE_FLUSH is set then