diff options
author | Dan Williams | 2016-03-08 16:16:07 +0100 |
---|---|---|
committer | Dan Williams | 2016-03-10 00:15:32 +0100 |
commit | 59e6473980f321c16299e12db69d1fabc2644a6f (patch) | |
tree | 6c59e4bb7a8a0f2208269643f5b7b8b056680aef /include/linux/pmem.h | |
parent | libnvdimm, pmem: fix kmap_atomic() leak in error path (diff) | |
download | kernel-qcow2-linux-59e6473980f321c16299e12db69d1fabc2644a6f.tar.gz kernel-qcow2-linux-59e6473980f321c16299e12db69d1fabc2644a6f.tar.xz kernel-qcow2-linux-59e6473980f321c16299e12db69d1fabc2644a6f.zip |
libnvdimm, pmem: clear poison on write
If a write is directed at a known bad block perform the following:
1/ write the data
2/ send a clear poison command
3/ invalidate the poison out of the cache hierarchy
Cc: <x86@kernel.org>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'include/linux/pmem.h')
-rw-r--r-- | include/linux/pmem.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/pmem.h b/include/linux/pmem.h index 7c3d11a6b4ad..3ec5309e29f3 100644 --- a/include/linux/pmem.h +++ b/include/linux/pmem.h @@ -58,6 +58,11 @@ static inline void arch_wb_cache_pmem(void __pmem *addr, size_t size) { BUG(); } + +static inline void arch_invalidate_pmem(void __pmem *addr, size_t size) +{ + BUG(); +} #endif /* @@ -186,6 +191,20 @@ static inline void clear_pmem(void __pmem *addr, size_t size) } /** + * invalidate_pmem - flush a pmem range from the cache hierarchy + * @addr: virtual start address + * @size: bytes to invalidate (internally aligned to cache line size) + * + * For platforms that support clearing poison this flushes any poisoned + * ranges out of the cache + */ +static inline void invalidate_pmem(void __pmem *addr, size_t size) +{ + if (arch_has_pmem_api()) + arch_invalidate_pmem(addr, size); +} + +/** * wb_cache_pmem - write back processor cache for PMEM memory range * @addr: virtual start address * @size: number of bytes to write back |