pmem.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. /*
  2. * Persistent Memory Driver
  3. *
  4. * Copyright (c) 2014-2015, Intel Corporation.
  5. * Copyright (c) 2015, Christoph Hellwig <hch@lst.de>.
  6. * Copyright (c) 2015, Boaz Harrosh <boaz@plexistor.com>.
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms and conditions of the GNU General Public License,
  10. * version 2, as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope it will be useful, but WITHOUT
  13. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  15. * more details.
  16. */
  17. #include <asm/cacheflush.h>
  18. #include <linux/blkdev.h>
  19. #include <linux/hdreg.h>
  20. #include <linux/init.h>
  21. #include <linux/platform_device.h>
  22. #include <linux/set_memory.h>
  23. #include <linux/module.h>
  24. #include <linux/moduleparam.h>
  25. #include <linux/badblocks.h>
  26. #include <linux/memremap.h>
  27. #include <linux/vmalloc.h>
  28. #include <linux/blk-mq.h>
  29. #include <linux/pfn_t.h>
  30. #include <linux/slab.h>
  31. #include <linux/uio.h>
  32. #include <linux/dax.h>
  33. #include <linux/nd.h>
  34. #include <linux/backing-dev.h>
  35. #include "pmem.h"
  36. #include "pfn.h"
  37. #include "nd.h"
  38. #include "nd-core.h"
  39. static struct device *to_dev(struct pmem_device *pmem)
  40. {
  41. /*
  42. * nvdimm bus services need a 'dev' parameter, and we record the device
  43. * at init in bb.dev.
  44. */
  45. return pmem->bb.dev;
  46. }
  47. static struct nd_region *to_region(struct pmem_device *pmem)
  48. {
  49. return to_nd_region(to_dev(pmem)->parent);
  50. }
  51. static void hwpoison_clear(struct pmem_device *pmem,
  52. phys_addr_t phys, unsigned int len)
  53. {
  54. unsigned long pfn_start, pfn_end, pfn;
  55. /* only pmem in the linear map supports HWPoison */
  56. if (is_vmalloc_addr(pmem->virt_addr))
  57. return;
  58. pfn_start = PHYS_PFN(phys);
  59. pfn_end = pfn_start + PHYS_PFN(len);
  60. for (pfn = pfn_start; pfn < pfn_end; pfn++) {
  61. struct page *page = pfn_to_page(pfn);
  62. /*
  63. * Note, no need to hold a get_dev_pagemap() reference
  64. * here since we're in the driver I/O path and
  65. * outstanding I/O requests pin the dev_pagemap.
  66. */
  67. if (test_and_clear_pmem_poison(page))
  68. clear_mce_nospec(pfn);
  69. }
  70. }
  71. static blk_status_t pmem_clear_poison(struct pmem_device *pmem,
  72. phys_addr_t offset, unsigned int len)
  73. {
  74. struct device *dev = to_dev(pmem);
  75. sector_t sector;
  76. long cleared;
  77. blk_status_t rc = BLK_STS_OK;
  78. sector = (offset - pmem->data_offset) / 512;
  79. cleared = nvdimm_clear_poison(dev, pmem->phys_addr + offset, len);
  80. if (cleared < len)
  81. rc = BLK_STS_IOERR;
  82. if (cleared > 0 && cleared / 512) {
  83. hwpoison_clear(pmem, pmem->phys_addr + offset, cleared);
  84. cleared /= 512;
  85. dev_dbg(dev, "%#llx clear %ld sector%s\n",
  86. (unsigned long long) sector, cleared,
  87. cleared > 1 ? "s" : "");
  88. badblocks_clear(&pmem->bb, sector, cleared);
  89. if (pmem->bb_state)
  90. sysfs_notify_dirent(pmem->bb_state);
  91. }
  92. arch_invalidate_pmem(pmem->virt_addr + offset, len);
  93. return rc;
  94. }
  95. static void write_pmem(void *pmem_addr, struct page *page,
  96. unsigned int off, unsigned int len)
  97. {
  98. unsigned int chunk;
  99. void *mem;
  100. while (len) {
  101. mem = kmap_atomic(page);
  102. chunk = min_t(unsigned int, len, PAGE_SIZE - off);
  103. memcpy_flushcache(pmem_addr, mem + off, chunk);
  104. kunmap_atomic(mem);
  105. len -= chunk;
  106. off = 0;
  107. page++;
  108. pmem_addr += chunk;
  109. }
  110. }
  111. static blk_status_t read_pmem(struct page *page, unsigned int off,
  112. void *pmem_addr, unsigned int len)
  113. {
  114. unsigned int chunk;
  115. unsigned long rem;
  116. void *mem;
  117. while (len) {
  118. mem = kmap_atomic(page);
  119. chunk = min_t(unsigned int, len, PAGE_SIZE - off);
  120. rem = memcpy_mcsafe(mem + off, pmem_addr, chunk);
  121. kunmap_atomic(mem);
  122. if (rem)
  123. return BLK_STS_IOERR;
  124. len -= chunk;
  125. off = 0;
  126. page++;
  127. pmem_addr += chunk;
  128. }
  129. return BLK_STS_OK;
  130. }
  131. static blk_status_t pmem_do_bvec(struct pmem_device *pmem, struct page *page,
  132. unsigned int len, unsigned int off, unsigned int op,
  133. sector_t sector)
  134. {
  135. blk_status_t rc = BLK_STS_OK;
  136. bool bad_pmem = false;
  137. phys_addr_t pmem_off = sector * 512 + pmem->data_offset;
  138. void *pmem_addr = pmem->virt_addr + pmem_off;
  139. if (unlikely(is_bad_pmem(&pmem->bb, sector, len)))
  140. bad_pmem = true;
  141. if (!op_is_write(op)) {
  142. if (unlikely(bad_pmem))
  143. rc = BLK_STS_IOERR;
  144. else {
  145. rc = read_pmem(page, off, pmem_addr, len);
  146. flush_dcache_page(page);
  147. }
  148. } else {
  149. /*
  150. * Note that we write the data both before and after
  151. * clearing poison. The write before clear poison
  152. * handles situations where the latest written data is
  153. * preserved and the clear poison operation simply marks
  154. * the address range as valid without changing the data.
  155. * In this case application software can assume that an
  156. * interrupted write will either return the new good
  157. * data or an error.
  158. *
  159. * However, if pmem_clear_poison() leaves the data in an
  160. * indeterminate state we need to perform the write
  161. * after clear poison.
  162. */
  163. flush_dcache_page(page);
  164. write_pmem(pmem_addr, page, off, len);
  165. if (unlikely(bad_pmem)) {
  166. rc = pmem_clear_poison(pmem, pmem_off, len);
  167. write_pmem(pmem_addr, page, off, len);
  168. }
  169. }
  170. return rc;
  171. }
  172. static blk_qc_t pmem_make_request(struct request_queue *q, struct bio *bio)
  173. {
  174. blk_status_t rc = 0;
  175. bool do_acct;
  176. unsigned long start;
  177. struct bio_vec bvec;
  178. struct bvec_iter iter;
  179. struct pmem_device *pmem = q->queuedata;
  180. struct nd_region *nd_region = to_region(pmem);
  181. if (bio->bi_opf & REQ_PREFLUSH)
  182. nvdimm_flush(nd_region);
  183. do_acct = nd_iostat_start(bio, &start);
  184. bio_for_each_segment(bvec, bio, iter) {
  185. rc = pmem_do_bvec(pmem, bvec.bv_page, bvec.bv_len,
  186. bvec.bv_offset, bio_op(bio), iter.bi_sector);
  187. if (rc) {
  188. bio->bi_status = rc;
  189. break;
  190. }
  191. }
  192. if (do_acct)
  193. nd_iostat_end(bio, start);
  194. if (bio->bi_opf & REQ_FUA)
  195. nvdimm_flush(nd_region);
  196. bio_endio(bio);
  197. return BLK_QC_T_NONE;
  198. }
  199. static int pmem_rw_page(struct block_device *bdev, sector_t sector,
  200. struct page *page, unsigned int op)
  201. {
  202. struct pmem_device *pmem = bdev->bd_queue->queuedata;
  203. blk_status_t rc;
  204. rc = pmem_do_bvec(pmem, page, hpage_nr_pages(page) * PAGE_SIZE,
  205. 0, op, sector);
  206. /*
  207. * The ->rw_page interface is subtle and tricky. The core
  208. * retries on any error, so we can only invoke page_endio() in
  209. * the successful completion case. Otherwise, we'll see crashes
  210. * caused by double completion.
  211. */
  212. if (rc == 0)
  213. page_endio(page, op_is_write(op), 0);
  214. return blk_status_to_errno(rc);
  215. }
  216. /* see "strong" declaration in tools/testing/nvdimm/pmem-dax.c */
  217. __weak long __pmem_direct_access(struct pmem_device *pmem, pgoff_t pgoff,
  218. long nr_pages, void **kaddr, pfn_t *pfn)
  219. {
  220. resource_size_t offset = PFN_PHYS(pgoff) + pmem->data_offset;
  221. if (unlikely(is_bad_pmem(&pmem->bb, PFN_PHYS(pgoff) / 512,
  222. PFN_PHYS(nr_pages))))
  223. return -EIO;
  224. if (kaddr)
  225. *kaddr = pmem->virt_addr + offset;
  226. if (pfn)
  227. *pfn = phys_to_pfn_t(pmem->phys_addr + offset, pmem->pfn_flags);
  228. /*
  229. * If badblocks are present, limit known good range to the
  230. * requested range.
  231. */
  232. if (unlikely(pmem->bb.count))
  233. return nr_pages;
  234. return PHYS_PFN(pmem->size - pmem->pfn_pad - offset);
  235. }
  236. static const struct block_device_operations pmem_fops = {
  237. .owner = THIS_MODULE,
  238. .rw_page = pmem_rw_page,
  239. .revalidate_disk = nvdimm_revalidate_disk,
  240. };
  241. static long pmem_dax_direct_access(struct dax_device *dax_dev,
  242. pgoff_t pgoff, long nr_pages, void **kaddr, pfn_t *pfn)
  243. {
  244. struct pmem_device *pmem = dax_get_private(dax_dev);
  245. return __pmem_direct_access(pmem, pgoff, nr_pages, kaddr, pfn);
  246. }
  247. /*
  248. * Use the 'no check' versions of copy_from_iter_flushcache() and
  249. * copy_to_iter_mcsafe() to bypass HARDENED_USERCOPY overhead. Bounds
  250. * checking, both file offset and device offset, is handled by
  251. * dax_iomap_actor()
  252. */
  253. static size_t pmem_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff,
  254. void *addr, size_t bytes, struct iov_iter *i)
  255. {
  256. return _copy_from_iter_flushcache(addr, bytes, i);
  257. }
  258. static size_t pmem_copy_to_iter(struct dax_device *dax_dev, pgoff_t pgoff,
  259. void *addr, size_t bytes, struct iov_iter *i)
  260. {
  261. return _copy_to_iter_mcsafe(addr, bytes, i);
  262. }
  263. static const struct dax_operations pmem_dax_ops = {
  264. .direct_access = pmem_dax_direct_access,
  265. .copy_from_iter = pmem_copy_from_iter,
  266. .copy_to_iter = pmem_copy_to_iter,
  267. };
  268. static const struct attribute_group *pmem_attribute_groups[] = {
  269. &dax_attribute_group,
  270. NULL,
  271. };
  272. static void pmem_release_queue(void *q)
  273. {
  274. blk_cleanup_queue(q);
  275. }
  276. static void pmem_freeze_queue(struct percpu_ref *ref)
  277. {
  278. struct request_queue *q;
  279. q = container_of(ref, typeof(*q), q_usage_counter);
  280. blk_freeze_queue_start(q);
  281. }
  282. static void pmem_release_disk(void *__pmem)
  283. {
  284. struct pmem_device *pmem = __pmem;
  285. kill_dax(pmem->dax_dev);
  286. put_dax(pmem->dax_dev);
  287. del_gendisk(pmem->disk);
  288. put_disk(pmem->disk);
  289. }
  290. static void pmem_release_pgmap_ops(void *__pgmap)
  291. {
  292. dev_pagemap_put_ops();
  293. }
  294. static void fsdax_pagefree(struct page *page, void *data)
  295. {
  296. wake_up_var(&page->_refcount);
  297. }
  298. static int setup_pagemap_fsdax(struct device *dev, struct dev_pagemap *pgmap)
  299. {
  300. dev_pagemap_get_ops();
  301. if (devm_add_action_or_reset(dev, pmem_release_pgmap_ops, pgmap))
  302. return -ENOMEM;
  303. pgmap->type = MEMORY_DEVICE_FS_DAX;
  304. pgmap->page_free = fsdax_pagefree;
  305. return 0;
  306. }
  307. static int pmem_attach_disk(struct device *dev,
  308. struct nd_namespace_common *ndns)
  309. {
  310. struct nd_namespace_io *nsio = to_nd_namespace_io(&ndns->dev);
  311. struct nd_region *nd_region = to_nd_region(dev->parent);
  312. int nid = dev_to_node(dev), fua;
  313. struct resource *res = &nsio->res;
  314. struct resource bb_res;
  315. struct nd_pfn *nd_pfn = NULL;
  316. struct dax_device *dax_dev;
  317. struct nd_pfn_sb *pfn_sb;
  318. struct pmem_device *pmem;
  319. struct request_queue *q;
  320. struct device *gendev;
  321. struct gendisk *disk;
  322. void *addr;
  323. int rc;
  324. pmem = devm_kzalloc(dev, sizeof(*pmem), GFP_KERNEL);
  325. if (!pmem)
  326. return -ENOMEM;
  327. /* while nsio_rw_bytes is active, parse a pfn info block if present */
  328. if (is_nd_pfn(dev)) {
  329. nd_pfn = to_nd_pfn(dev);
  330. rc = nvdimm_setup_pfn(nd_pfn, &pmem->pgmap);
  331. if (rc)
  332. return rc;
  333. }
  334. /* we're attaching a block device, disable raw namespace access */
  335. devm_nsio_disable(dev, nsio);
  336. dev_set_drvdata(dev, pmem);
  337. pmem->phys_addr = res->start;
  338. pmem->size = resource_size(res);
  339. fua = nvdimm_has_flush(nd_region);
  340. if (!IS_ENABLED(CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE) || fua < 0) {
  341. dev_warn(dev, "unable to guarantee persistence of writes\n");
  342. fua = 0;
  343. }
  344. if (!devm_request_mem_region(dev, res->start, resource_size(res),
  345. dev_name(&ndns->dev))) {
  346. dev_warn(dev, "could not reserve region %pR\n", res);
  347. return -EBUSY;
  348. }
  349. q = blk_alloc_queue_node(GFP_KERNEL, dev_to_node(dev), NULL);
  350. if (!q)
  351. return -ENOMEM;
  352. if (devm_add_action_or_reset(dev, pmem_release_queue, q))
  353. return -ENOMEM;
  354. pmem->pfn_flags = PFN_DEV;
  355. pmem->pgmap.ref = &q->q_usage_counter;
  356. pmem->pgmap.kill = pmem_freeze_queue;
  357. if (is_nd_pfn(dev)) {
  358. if (setup_pagemap_fsdax(dev, &pmem->pgmap))
  359. return -ENOMEM;
  360. addr = devm_memremap_pages(dev, &pmem->pgmap);
  361. pfn_sb = nd_pfn->pfn_sb;
  362. pmem->data_offset = le64_to_cpu(pfn_sb->dataoff);
  363. pmem->pfn_pad = resource_size(res) -
  364. resource_size(&pmem->pgmap.res);
  365. pmem->pfn_flags |= PFN_MAP;
  366. memcpy(&bb_res, &pmem->pgmap.res, sizeof(bb_res));
  367. bb_res.start += pmem->data_offset;
  368. } else if (pmem_should_map_pages(dev)) {
  369. memcpy(&pmem->pgmap.res, &nsio->res, sizeof(pmem->pgmap.res));
  370. pmem->pgmap.altmap_valid = false;
  371. if (setup_pagemap_fsdax(dev, &pmem->pgmap))
  372. return -ENOMEM;
  373. addr = devm_memremap_pages(dev, &pmem->pgmap);
  374. pmem->pfn_flags |= PFN_MAP;
  375. memcpy(&bb_res, &pmem->pgmap.res, sizeof(bb_res));
  376. } else {
  377. addr = devm_memremap(dev, pmem->phys_addr,
  378. pmem->size, ARCH_MEMREMAP_PMEM);
  379. memcpy(&bb_res, &nsio->res, sizeof(bb_res));
  380. }
  381. if (IS_ERR(addr))
  382. return PTR_ERR(addr);
  383. pmem->virt_addr = addr;
  384. blk_queue_write_cache(q, true, fua);
  385. blk_queue_make_request(q, pmem_make_request);
  386. blk_queue_physical_block_size(q, PAGE_SIZE);
  387. blk_queue_logical_block_size(q, pmem_sector_size(ndns));
  388. blk_queue_max_hw_sectors(q, UINT_MAX);
  389. blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
  390. if (pmem->pfn_flags & PFN_MAP)
  391. blk_queue_flag_set(QUEUE_FLAG_DAX, q);
  392. q->queuedata = pmem;
  393. disk = alloc_disk_node(0, nid);
  394. if (!disk)
  395. return -ENOMEM;
  396. pmem->disk = disk;
  397. disk->fops = &pmem_fops;
  398. disk->queue = q;
  399. disk->flags = GENHD_FL_EXT_DEVT;
  400. disk->queue->backing_dev_info->capabilities |= BDI_CAP_SYNCHRONOUS_IO;
  401. nvdimm_namespace_disk_name(ndns, disk->disk_name);
  402. set_capacity(disk, (pmem->size - pmem->pfn_pad - pmem->data_offset)
  403. / 512);
  404. if (devm_init_badblocks(dev, &pmem->bb))
  405. return -ENOMEM;
  406. nvdimm_badblocks_populate(nd_region, &pmem->bb, &bb_res);
  407. disk->bb = &pmem->bb;
  408. dax_dev = alloc_dax(pmem, disk->disk_name, &pmem_dax_ops);
  409. if (!dax_dev) {
  410. put_disk(disk);
  411. return -ENOMEM;
  412. }
  413. dax_write_cache(dax_dev, nvdimm_has_cache(nd_region));
  414. pmem->dax_dev = dax_dev;
  415. gendev = disk_to_dev(disk);
  416. gendev->groups = pmem_attribute_groups;
  417. device_add_disk(dev, disk);
  418. if (devm_add_action_or_reset(dev, pmem_release_disk, pmem))
  419. return -ENOMEM;
  420. revalidate_disk(disk);
  421. pmem->bb_state = sysfs_get_dirent(disk_to_dev(disk)->kobj.sd,
  422. "badblocks");
  423. if (!pmem->bb_state)
  424. dev_warn(dev, "'badblocks' notification disabled\n");
  425. return 0;
  426. }
  427. static int nd_pmem_probe(struct device *dev)
  428. {
  429. struct nd_namespace_common *ndns;
  430. ndns = nvdimm_namespace_common_probe(dev);
  431. if (IS_ERR(ndns))
  432. return PTR_ERR(ndns);
  433. if (devm_nsio_enable(dev, to_nd_namespace_io(&ndns->dev)))
  434. return -ENXIO;
  435. if (is_nd_btt(dev))
  436. return nvdimm_namespace_attach_btt(ndns);
  437. if (is_nd_pfn(dev))
  438. return pmem_attach_disk(dev, ndns);
  439. /* if we find a valid info-block we'll come back as that personality */
  440. if (nd_btt_probe(dev, ndns) == 0 || nd_pfn_probe(dev, ndns) == 0
  441. || nd_dax_probe(dev, ndns) == 0)
  442. return -ENXIO;
  443. /* ...otherwise we're just a raw pmem device */
  444. return pmem_attach_disk(dev, ndns);
  445. }
  446. static int nd_pmem_remove(struct device *dev)
  447. {
  448. struct pmem_device *pmem = dev_get_drvdata(dev);
  449. if (is_nd_btt(dev))
  450. nvdimm_namespace_detach_btt(to_nd_btt(dev));
  451. else {
  452. /*
  453. * Note, this assumes device_lock() context to not race
  454. * nd_pmem_notify()
  455. */
  456. sysfs_put(pmem->bb_state);
  457. pmem->bb_state = NULL;
  458. }
  459. nvdimm_flush(to_nd_region(dev->parent));
  460. return 0;
  461. }
  462. static void nd_pmem_shutdown(struct device *dev)
  463. {
  464. nvdimm_flush(to_nd_region(dev->parent));
  465. }
  466. static void nd_pmem_notify(struct device *dev, enum nvdimm_event event)
  467. {
  468. struct nd_region *nd_region;
  469. resource_size_t offset = 0, end_trunc = 0;
  470. struct nd_namespace_common *ndns;
  471. struct nd_namespace_io *nsio;
  472. struct resource res;
  473. struct badblocks *bb;
  474. struct kernfs_node *bb_state;
  475. if (event != NVDIMM_REVALIDATE_POISON)
  476. return;
  477. if (is_nd_btt(dev)) {
  478. struct nd_btt *nd_btt = to_nd_btt(dev);
  479. ndns = nd_btt->ndns;
  480. nd_region = to_nd_region(ndns->dev.parent);
  481. nsio = to_nd_namespace_io(&ndns->dev);
  482. bb = &nsio->bb;
  483. bb_state = NULL;
  484. } else {
  485. struct pmem_device *pmem = dev_get_drvdata(dev);
  486. nd_region = to_region(pmem);
  487. bb = &pmem->bb;
  488. bb_state = pmem->bb_state;
  489. if (is_nd_pfn(dev)) {
  490. struct nd_pfn *nd_pfn = to_nd_pfn(dev);
  491. struct nd_pfn_sb *pfn_sb = nd_pfn->pfn_sb;
  492. ndns = nd_pfn->ndns;
  493. offset = pmem->data_offset +
  494. __le32_to_cpu(pfn_sb->start_pad);
  495. end_trunc = __le32_to_cpu(pfn_sb->end_trunc);
  496. } else {
  497. ndns = to_ndns(dev);
  498. }
  499. nsio = to_nd_namespace_io(&ndns->dev);
  500. }
  501. res.start = nsio->res.start + offset;
  502. res.end = nsio->res.end - end_trunc;
  503. nvdimm_badblocks_populate(nd_region, bb, &res);
  504. if (bb_state)
  505. sysfs_notify_dirent(bb_state);
  506. }
  507. MODULE_ALIAS("pmem");
  508. MODULE_ALIAS_ND_DEVICE(ND_DEVICE_NAMESPACE_IO);
  509. MODULE_ALIAS_ND_DEVICE(ND_DEVICE_NAMESPACE_PMEM);
  510. static struct nd_device_driver nd_pmem_driver = {
  511. .probe = nd_pmem_probe,
  512. .remove = nd_pmem_remove,
  513. .notify = nd_pmem_notify,
  514. .shutdown = nd_pmem_shutdown,
  515. .drv = {
  516. .name = "nd_pmem",
  517. },
  518. .type = ND_DRIVER_NAMESPACE_IO | ND_DRIVER_NAMESPACE_PMEM,
  519. };
  520. module_nd_driver(nd_pmem_driver);
  521. MODULE_AUTHOR("Ross Zwisler <ross.zwisler@linux.intel.com>");
  522. MODULE_LICENSE("GPL v2");