summaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2016-01-24 00:34:10 +0100
committerDan Williams <dan.j.williams@intel.com>2016-01-26 18:40:32 +0100
commit9c41242817f4b6d908886c0fdb036d9246c50630 (patch)
tree670527d47e04acfd29c587d968eb9c9617d192dd /drivers/nvdimm
parentLinux 4.5-rc1 (diff)
downloadlinux-9c41242817f4b6d908886c0fdb036d9246c50630.tar.xz
linux-9c41242817f4b6d908886c0fdb036d9246c50630.zip
libnvdimm: fix mode determination for e820 devices
Correctly display "safe" mode when a btt is established on a e820/memmap defined pmem namespace. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm')
-rw-r--r--drivers/nvdimm/namespace_devs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c
index 8ebfcaae3f5a..9edf7eb7d17c 100644
--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -1277,10 +1277,12 @@ static ssize_t mode_show(struct device *dev,
device_lock(dev);
claim = ndns->claim;
- if (pmem_should_map_pages(dev) || (claim && is_nd_pfn(claim)))
- mode = "memory";
- else if (claim && is_nd_btt(claim))
+ if (claim && is_nd_btt(claim))
mode = "safe";
+ else if (claim && is_nd_pfn(claim))
+ mode = "memory";
+ else if (!claim && pmem_should_map_pages(dev))
+ mode = "memory";
else
mode = "raw";
rc = sprintf(buf, "%s\n", mode);