]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
libnvdimm, pmem: move pmem to drivers/nvdimm/
authorDan Williams <dan.j.williams@intel.com>
Tue, 9 Jun 2015 18:13:37 +0000 (14:13 -0400)
committerDan Duval <dan.duval@oracle.com>
Tue, 11 Oct 2016 18:35:33 +0000 (14:35 -0400)
Orabug: 22913653

Prepare the pmem driver to consume PMEM namespaces emitted by regions of
an nvdimm_bus instance.  No functional change.

Acked-by: Christoph Hellwig <hch@lst.de>
Tested-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
drivers/block/Kconfig
drivers/block/Makefile
drivers/nvdimm/Kconfig
drivers/nvdimm/Makefile
drivers/nvdimm/pmem.c [moved from drivers/block/pmem.c with 97% similarity]

index e5a5d13c3aad23f9f4001d8d7f4060deb63fdeab..cbe0595dc5fb5d0e6967978771b2b648adc0b5c3 100644 (file)
@@ -393,18 +393,6 @@ config BLK_DEV_RAM_DAX
          and will prevent RAM block device backing store memory from being
          allocated from highmem (only a problem for highmem systems).
 
-config BLK_DEV_PMEM
-       tristate "Persistent memory block device support"
-       depends on HAS_IOMEM
-       help
-         Saying Y here will allow you to use a contiguous range of reserved
-         memory as one or more persistent block devices.
-
-         To compile this driver as a module, choose M here: the module will be
-         called 'pmem'.
-
-         If unsure, say N.
-
 config CDROM_PKTCDVD
        tristate "Packet writing on CD/DVD media"
        depends on !UML
index 68a4d64fcf281754dcd787502d80d24a53c4851d..a278c2cfdab730098c515da1a69e62437ca9b02d 100644 (file)
@@ -14,7 +14,6 @@ obj-$(CONFIG_PS3_VRAM)                += ps3vram.o
 obj-$(CONFIG_ATARI_FLOPPY)     += ataflop.o
 obj-$(CONFIG_AMIGA_Z2RAM)      += z2ram.o
 obj-$(CONFIG_BLK_DEV_RAM)      += brd.o
-obj-$(CONFIG_BLK_DEV_PMEM)     += pmem.o
 obj-$(CONFIG_BLK_DEV_LOOP)     += loop.o
 obj-$(CONFIG_BLK_CPQ_DA)       += cpqarray.o
 obj-$(CONFIG_BLK_CPQ_CISS_DA)  += cciss.o
index 92933551f84692ed8940b3bf9d894ffd6f94bd44..07a29113b870873d57e17609d583c305dee2b321 100644 (file)
@@ -1,4 +1,4 @@
-config LIBNVDIMM
+menuconfig LIBNVDIMM
        tristate "NVDIMM (Non-Volatile Memory Device) Support"
        depends on PHYS_ADDR_T_64BIT
        depends on BLK_DEV
@@ -13,3 +13,24 @@ config LIBNVDIMM
          CONFIG_DAX).  A BLK namespace refers to an NVDIMM control
          region which exposes an mmio register set for windowed
          access mode to non-volatile memory.
+
+if LIBNVDIMM
+
+config BLK_DEV_PMEM
+       tristate "PMEM: Persistent memory block device support"
+       default LIBNVDIMM
+       depends on HAS_IOMEM
+       help
+         Memory ranges for PMEM are described by either an NFIT
+         (NVDIMM Firmware Interface Table, see CONFIG_NFIT_ACPI), a
+         non-standard OEM-specific E820 memory type (type-12, see
+         CONFIG_X86_PMEM_LEGACY), or it is manually specified by the
+         'memmap=nn[KMG]!ss[KMG]' kernel command line (see
+         Documentation/kernel-parameters.txt).  This driver converts
+         these persistent memory ranges into block devices that are
+         capable of DAX (direct-access) file system mappings.  See
+         Documentation/nvdimm/nvdimm.txt for more details.
+
+         Say Y if you want to use an NVDIMM
+
+endif
index af5e2760ddbd5b2e1ce675cb4ce0e4386943dd8b..4d2a27f52faac7bf429dee268049d1265e8f4518 100644 (file)
@@ -1,4 +1,7 @@
 obj-$(CONFIG_LIBNVDIMM) += libnvdimm.o
+obj-$(CONFIG_BLK_DEV_PMEM) += nd_pmem.o
+
+nd_pmem-y := pmem.o
 
 libnvdimm-y := core.o
 libnvdimm-y += bus.o
similarity index 97%
rename from drivers/block/pmem.c
rename to drivers/nvdimm/pmem.c
index 095dfaadcaa5f3ceefd42acd8c044a8103d71c44..eabf4a8d00855ef06c2c2e9cd4178954903fe47c 100644 (file)
@@ -139,11 +139,11 @@ static struct pmem_device *pmem_alloc(struct device *dev, struct resource *res)
        }
 
        /*
-        * Map the memory as write-through, as we can't write back the contents
+        * Map the memory as non-cachable, as we can't write back the contents
         * of the CPU caches in case of a crash.
         */
        err = -ENOMEM;
-       pmem->virt_addr = ioremap_wt(pmem->phys_addr, pmem->size);
+       pmem->virt_addr = ioremap_nocache(pmem->phys_addr, pmem->size);
        if (!pmem->virt_addr)
                goto out_release_region;