Message ID | 20151019182914.GA23254@linux.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 0ba6a97..3f735a6 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -451,6 +451,20 @@ static int __init pmem_init(void) { int error; + unsigned long clflush_size = boot_cpu_data.x86_clflush_size; + const unsigned int size = PAGE_SIZE; + void *addr = kmalloc(size, GFP_KERNEL); + void *end = addr + size; + void *p; + + mb(); + for (p = (void *)((unsigned long)addr & -clflush_size); p < end; + p += clflush_size) + clflush(p); + mb(); + + kfree(addr); + pmem_major = register_blkdev(0, "pmem"); if (pmem_major < 0) return pmem_major;