Skip to content

Commit 480b683

Browse files
oohaldjbw
authored andcommitted
nvdimm: fix PHYS_PFN/PFN_PHYS mixup
nd_activate_region() iomaps any hint addresses required when activating a region. To prevent duplicate mappings it checks the PFN of the hint to be mapped against the PFNs of the already mapped hints. Unfortunately it doesn't convert the PFN back into a physical address before passing it to devm_nvdimm_ioremap(). Instead it applies PHYS_PFN a second time which ends about as well as you would imagine. Signed-off-by: Oliver O'Halloran <[email protected]> Signed-off-by: Dan Williams <[email protected]>
1 parent 3be7988 commit 480b683

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvdimm/region_devs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static int nvdimm_map_flush(struct device *dev, struct nvdimm *nvdimm, int dimm,
5757
ndrd->flush_wpq[dimm][j] & PAGE_MASK);
5858
else
5959
flush_page = devm_nvdimm_ioremap(dev,
60-
PHYS_PFN(pfn), PAGE_SIZE);
60+
PFN_PHYS(pfn), PAGE_SIZE);
6161
if (!flush_page)
6262
return -ENXIO;
6363
ndrd->flush_wpq[dimm][i] = flush_page

0 commit comments

Comments
 (0)