From 59e6473980f321c16299e12db69d1fabc2644a6f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 8 Mar 2016 07:16:07 -0800 Subject: 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: Cc: Ross Zwisler Reviewed-by: Vishal Verma Signed-off-by: Dan Williams --- arch/x86/include/asm/pmem.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'arch') diff --git a/arch/x86/include/asm/pmem.h b/arch/x86/include/asm/pmem.h index c57fd1ea9689..bf8b35d2035a 100644 --- a/arch/x86/include/asm/pmem.h +++ b/arch/x86/include/asm/pmem.h @@ -137,6 +137,11 @@ static inline void arch_clear_pmem(void __pmem *addr, size_t size) arch_wb_cache_pmem(addr, size); } +static inline void arch_invalidate_pmem(void __pmem *addr, size_t size) +{ + clflush_cache_range((void __force *) addr, size); +} + static inline bool __arch_has_wmb_pmem(void) { /* -- cgit v1.2.3-59-g8ed1b