Skip to content

Commit f05c643

Browse files
committed
Merge tag 'libnvdimm-fixes-5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm
Pull libnvdimm fixes from Dan Williams: "A fix for a regression added this cycle in the pmem driver, and for a long standing bug for failed NUMA node lookups on ARM64. This has appeared in -next for several days with no reported issues. Summary: - Fix a regression that caused the sysfs ABI for pmem block devices to not be registered. This fails the nvdimm unit tests and dax xfstests. - Fix numa node lookups for dax-kmem memory (device-dax memory assigned to the page allocator) on ARM64" * tag 'libnvdimm-fixes-5.15-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: nvdimm/pmem: fix creating the dax group ACPI: NFIT: Use fallback node id when numa info in NFIT table is incorrect
2 parents 6e9bfdc + d55174c commit f05c643

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
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

drivers/nvdimm/pmem.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,6 @@ static int pmem_attach_disk(struct device *dev,
380380
struct nd_pfn_sb *pfn_sb;
381381
struct pmem_device *pmem;
382382
struct request_queue *q;
383-
struct device *gendev;
384383
struct gendisk *disk;
385384
void *addr;
386385
int rc;
@@ -489,10 +488,8 @@ static int pmem_attach_disk(struct device *dev,
489488
}
490489
dax_write_cache(dax_dev, nvdimm_has_cache(nd_region));
491490
pmem->dax_dev = dax_dev;
492-
gendev = disk_to_dev(disk);
493-
gendev->groups = pmem_attribute_groups;
494491

495-
device_add_disk(dev, disk, NULL);
492+
device_add_disk(dev, disk, pmem_attribute_groups);
496493
if (devm_add_action_or_reset(dev, pmem_release_disk, pmem))
497494
return -ENOMEM;
498495

0 commit comments

Comments
 (0)