summaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-11-10 15:07:22 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-10 15:07:22 -0500
commit264015f8a83fefc62c5125d761fbbadf924e520c (patch)
tree6a0602761abb3d866471861a7128a5177a855fd0 /drivers/nvdimm
parentd55fc37856244c929965c190c8e9dcb49e2c07aa (diff)
parentab27a8d04b32b6ee8c30c14c4afd1058e8addc82 (diff)
Merge tag 'libnvdimm-for-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm
Pull libnvdimm updates from Dan Williams: "Outside of the new ACPI-NFIT hot-add support this pull request is more notable for what it does not contain, than what it does. There were a handful of development topics this cycle, dax get_user_pages, dax fsync, and raw block dax, that need more more iteration and will wait for 4.5. The patches to make devm and the pmem driver NUMA aware have been in -next for several weeks. The hot-add support has not, but is contained to the NFIT driver and is passing unit tests. The coredump support is straightforward and was looked over by Jeff. All of it has received a 0day build success notification across 107 configs. Summary: - Add support for the ACPI 6.0 NFIT hot add mechanism to process updates of the NFIT at runtime. - Teach the coredump implementation how to filter out DAX mappings. - Introduce NUMA hints for allocations made by the pmem driver, and as a side effect all devm allocations now hint their NUMA node by default" * tag 'libnvdimm-for-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: coredump: add DAX filtering for FDPIC ELF coredumps coredump: add DAX filtering for ELF coredumps acpi: nfit: Add support for hot-add nfit: in acpi_nfit_init, break on a 0-length table pmem, memremap: convert to numa aware allocations devm_memremap_pages: use numa_mem_id devm: make allocations numa aware by default devm_memremap: convert to return ERR_PTR devm_memunmap: use devres_release() pmem: kill memremap_pmem() x86, mm: quiet arch_add_memory()
Diffstat (limited to 'drivers/nvdimm')
-rw-r--r--drivers/nvdimm/pmem.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index 0ba6a978f227..349f03e7ed06 100644
--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -150,18 +150,15 @@ static struct pmem_device *pmem_alloc(struct device *dev,
150 return ERR_PTR(-EBUSY); 150 return ERR_PTR(-EBUSY);
151 } 151 }
152 152
153 if (pmem_should_map_pages(dev)) { 153 if (pmem_should_map_pages(dev))
154 void *addr = devm_memremap_pages(dev, res); 154 pmem->virt_addr = (void __pmem *) devm_memremap_pages(dev, res);
155 else
156 pmem->virt_addr = (void __pmem *) devm_memremap(dev,
157 pmem->phys_addr, pmem->size,
158 ARCH_MEMREMAP_PMEM);
155 159
156 if (IS_ERR(addr)) 160 if (IS_ERR(pmem->virt_addr))
157 return addr; 161 return (void __force *) pmem->virt_addr;
158 pmem->virt_addr = (void __pmem *) addr;
159 } else {
160 pmem->virt_addr = memremap_pmem(dev, pmem->phys_addr,
161 pmem->size);
162 if (!pmem->virt_addr)
163 return ERR_PTR(-ENXIO);
164 }
165 162
166 return pmem; 163 return pmem;
167} 164}
@@ -179,9 +176,10 @@ static void pmem_detach_disk(struct pmem_device *pmem)
179static int pmem_attach_disk(struct device *dev, 176static int pmem_attach_disk(struct device *dev,
180 struct nd_namespace_common *ndns, struct pmem_device *pmem) 177 struct nd_namespace_common *ndns, struct pmem_device *pmem)
181{ 178{
179 int nid = dev_to_node(dev);
182 struct gendisk *disk; 180 struct gendisk *disk;
183 181
184 pmem->pmem_queue = blk_alloc_queue(GFP_KERNEL); 182 pmem->pmem_queue = blk_alloc_queue_node(GFP_KERNEL, nid);
185 if (!pmem->pmem_queue) 183 if (!pmem->pmem_queue)
186 return -ENOMEM; 184 return -ENOMEM;
187 185
@@ -191,7 +189,7 @@ static int pmem_attach_disk(struct device *dev,
191 blk_queue_bounce_limit(pmem->pmem_queue, BLK_BOUNCE_ANY); 189 blk_queue_bounce_limit(pmem->pmem_queue, BLK_BOUNCE_ANY);
192 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, pmem->pmem_queue); 190 queue_flag_set_unlocked(QUEUE_FLAG_NONROT, pmem->pmem_queue);
193 191
194 disk = alloc_disk(0); 192 disk = alloc_disk_node(0, nid);
195 if (!disk) { 193 if (!disk) {
196 blk_cleanup_queue(pmem->pmem_queue); 194 blk_cleanup_queue(pmem->pmem_queue);
197 return -ENOMEM; 195 return -ENOMEM;
@@ -363,8 +361,8 @@ static int nvdimm_namespace_attach_pfn(struct nd_namespace_common *ndns)
363 361
364 /* establish pfn range for lookup, and switch to direct map */ 362 /* establish pfn range for lookup, and switch to direct map */
365 pmem = dev_get_drvdata(dev); 363 pmem = dev_get_drvdata(dev);
366 memunmap_pmem(dev, pmem->virt_addr); 364 devm_memunmap(dev, (void __force *) pmem->virt_addr);
367 pmem->virt_addr = (void __pmem *)devm_memremap_pages(dev, &nsio->res); 365 pmem->virt_addr = (void __pmem *) devm_memremap_pages(dev, &nsio->res);
368 if (IS_ERR(pmem->virt_addr)) { 366 if (IS_ERR(pmem->virt_addr)) {
369 rc = PTR_ERR(pmem->virt_addr); 367 rc = PTR_ERR(pmem->virt_addr);
370 goto err; 368 goto err;