Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'libnvdimm-for-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm

Pull libnvdimm updates from Ira Weiny:
"A kmap conversion and a bug fix this go around:

- drivers/nvdimm: Use local kmaps

- nvdimm: virtio_pmem: serialize flush requests"

* tag 'libnvdimm-for-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
nvdimm: virtio_pmem: serialize flush requests
drivers/nvdimm: Use local kmaps

+17 -11
+6 -6
drivers/nvdimm/btt.c
··· 1104 1104 { 1105 1105 int ret; 1106 1106 u64 nsoff = to_namespace_offset(arena, lba); 1107 - void *mem = kmap_atomic(page); 1107 + void *mem = kmap_local_page(page); 1108 1108 1109 1109 ret = arena_read_bytes(arena, nsoff, mem + off, len, NVDIMM_IO_ATOMIC); 1110 - kunmap_atomic(mem); 1110 + kunmap_local(mem); 1111 1111 1112 1112 return ret; 1113 1113 } ··· 1117 1117 { 1118 1118 int ret; 1119 1119 u64 nsoff = to_namespace_offset(arena, lba); 1120 - void *mem = kmap_atomic(page); 1120 + void *mem = kmap_local_page(page); 1121 1121 1122 1122 ret = arena_write_bytes(arena, nsoff, mem + off, len, NVDIMM_IO_ATOMIC); 1123 - kunmap_atomic(mem); 1123 + kunmap_local(mem); 1124 1124 1125 1125 return ret; 1126 1126 } 1127 1127 1128 1128 static void zero_fill_data(struct page *page, unsigned int off, u32 len) 1129 1129 { 1130 - void *mem = kmap_atomic(page); 1130 + void *mem = kmap_local_page(page); 1131 1131 1132 1132 memset(mem + off, 0, len); 1133 - kunmap_atomic(mem); 1133 + kunmap_local(mem); 1134 1134 } 1135 1135 1136 1136 #ifdef CONFIG_BLK_DEV_INTEGRITY
+2 -1
drivers/nvdimm/nd_virtio.c
··· 44 44 unsigned long flags; 45 45 int err, err1; 46 46 47 + guard(mutex)(&vpmem->flush_lock); 48 + 47 49 /* 48 50 * Don't bother to submit the request to the device if the device is 49 51 * not activated. ··· 55 53 return -EIO; 56 54 } 57 55 58 - might_sleep(); 59 56 req_data = kmalloc(sizeof(*req_data), GFP_KERNEL); 60 57 if (!req_data) 61 58 return -ENOMEM;
+4 -4
drivers/nvdimm/pmem.c
··· 128 128 void *mem; 129 129 130 130 while (len) { 131 - mem = kmap_atomic(page); 131 + mem = kmap_local_page(page); 132 132 chunk = min_t(unsigned int, len, PAGE_SIZE - off); 133 133 memcpy_flushcache(pmem_addr, mem + off, chunk); 134 - kunmap_atomic(mem); 134 + kunmap_local(mem); 135 135 len -= chunk; 136 136 off = 0; 137 137 page++; ··· 147 147 void *mem; 148 148 149 149 while (len) { 150 - mem = kmap_atomic(page); 150 + mem = kmap_local_page(page); 151 151 chunk = min_t(unsigned int, len, PAGE_SIZE - off); 152 152 rem = copy_mc_to_kernel(mem + off, pmem_addr, chunk); 153 - kunmap_atomic(mem); 153 + kunmap_local(mem); 154 154 if (rem) 155 155 return BLK_STS_IOERR; 156 156 len -= chunk;
+1
drivers/nvdimm/virtio_pmem.c
··· 64 64 goto out_err; 65 65 } 66 66 67 + mutex_init(&vpmem->flush_lock); 67 68 vpmem->vdev = vdev; 68 69 vdev->priv = vpmem; 69 70 err = init_vq(vpmem);
+4
drivers/nvdimm/virtio_pmem.h
··· 13 13 #include <linux/module.h> 14 14 #include <uapi/linux/virtio_pmem.h> 15 15 #include <linux/libnvdimm.h> 16 + #include <linux/mutex.h> 16 17 #include <linux/spinlock.h> 17 18 18 19 struct virtio_pmem_request { ··· 35 34 36 35 /* Virtio pmem request queue */ 37 36 struct virtqueue *req_vq; 37 + 38 + /* Serialize flush requests to the device. */ 39 + struct mutex flush_lock; 38 40 39 41 /* nvdimm bus registers virtio pmem device */ 40 42 struct nvdimm_bus *nvdimm_bus;