Message ID | 20210804043231.2655537-19-ira.weiny@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | PKS/PMEM: Add Stray Write Protection | expand |
diff --git a/drivers/dax/device.c b/drivers/dax/device.c index dd8222a42808..cdf6ef4c1edb 100644 --- a/drivers/dax/device.c +++ b/drivers/dax/device.c @@ -426,6 +426,8 @@ int dev_dax_probe(struct dev_dax *dev_dax) } pgmap->type = MEMORY_DEVICE_GENERIC; + if (pgmap_protection_enabled()) + pgmap->flags |= PGMAP_PROTECTION; addr = devm_memremap_pages(dev, pgmap); if (IS_ERR(addr)) return PTR_ERR(addr);