summaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm
diff options
context:
space:
mode:
authorOliver O'Halloran2016-09-19 12:19:00 +0200
committerDan Williams2016-09-19 17:54:27 +0200
commit480b6837aa579991c6acc113bccf838e6a90843c (patch)
tree71aca7c1b20a42e451eca88044a2a81a777e827a /drivers/nvdimm
parentLinux 4.8-rc7 (diff)
downloadkernel-qcow2-linux-480b6837aa579991c6acc113bccf838e6a90843c.tar.gz
kernel-qcow2-linux-480b6837aa579991c6acc113bccf838e6a90843c.tar.xz
kernel-qcow2-linux-480b6837aa579991c6acc113bccf838e6a90843c.zip
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 <oohall@gmail.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm')
-rw-r--r--drivers/nvdimm/region_devs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c
index e8d5ba7b29af..4eef88eb5144 100644
--- a/drivers/nvdimm/region_devs.c
+++ b/drivers/nvdimm/region_devs.c
@@ -57,7 +57,7 @@ static int nvdimm_map_flush(struct device *dev, struct nvdimm *nvdimm, int dimm,
ndrd->flush_wpq[dimm][j] & PAGE_MASK);
else
flush_page = devm_nvdimm_ioremap(dev,
- PHYS_PFN(pfn), PAGE_SIZE);
+ PFN_PHYS(pfn), PAGE_SIZE);
if (!flush_page)
return -ENXIO;
ndrd->flush_wpq[dimm][i] = flush_page