[PATCH v2 00/25] replace ioremap_{cache|wt} with memremap
by Dan Williams
Changes since v1 [1]:
1/ Drop the attempt at unifying ioremap() prototypes, just focus on
converting ioremap_cache and ioremap_wt over to memremap (Christoph)
2/ Drop the unrelated cleanups to use %pa in __ioremap_caller (Thomas)
3/ Add support for memremap() attempts on "System RAM" to simply return
the kernel virtual address for that range. ARM depends on this
functionality in ioremap_cache() and ACPI was open coding a similar
solution. (Mark)
4/ Split the conversions of ioremap_{cache|wt} into separate patches per
driver / arch.
5/ Fix bisection breakage and other reports from 0day-kbuild
---
While developing the pmem driver we noticed that the __iomem annotation
on the return value from ioremap_cache() was being mishandled by several
callers. We also observed that all of the call sites expected to be
able to treat the return value from ioremap_cache() as normal
(non-__iomem) pointer to memory.
This patchset takes the opportunity to clean up the above confusion as
well as a few issues with the ioremap_{cache|wt} interface, including:
1/ Eliminating the possibility of function prototypes differing between
architectures by defining a central memremap() prototype that takes
flags to determine the mapping type.
2/ Returning NULL rather than falling back silently to a different
mapping-type. This allows drivers to be stricter about the
mapping-type fallbacks that are permissible.
[1]: http://marc.info/?l=linux-arm-kernel&m=143735199029255&w=2
---
Dan Williams (22):
mm: enhance region_is_ram() to distinguish 'unknown' vs 'mixed'
arch, drivers: don't include <asm/io.h> directly, use <linux/io.h> instead
cleanup IORESOURCE_CACHEABLE vs ioremap()
intel_iommu: fix leaked ioremap mapping
arch: introduce memremap()
arm: switch from ioremap_cache to memremap
x86: switch from ioremap_cache to memremap
gma500: switch from acpi_os_ioremap to ioremap
i915: switch from acpi_os_ioremap to ioremap
acpi: switch from ioremap_cache to memremap
toshiba laptop: replace ioremap_cache with ioremap
memconsole: fix __iomem mishandling, switch to memremap
visorbus: switch from ioremap_cache to memremap
intel-iommu: switch from ioremap_cache to memremap
libnvdimm, pmem: switch from ioremap_cache to memremap
pxa2xx-flash: switch from ioremap_cache to memremap
sfi: switch from ioremap_cache to memremap
fbdev: switch from ioremap_wt to memremap
pmem: switch from ioremap_wt to memremap
arch: remove ioremap_cache, replace with arch_memremap
arch: remove ioremap_wt, replace with arch_memremap
pmem: convert to generic memremap
Toshi Kani (3):
mm, x86: Fix warning in ioremap RAM check
mm, x86: Remove region_is_ram() call from ioremap
mm: Fix bugs in region_is_ram()
arch/arc/include/asm/io.h | 1
arch/arm/Kconfig | 1
arch/arm/include/asm/io.h | 13 +++-
arch/arm/include/asm/xen/page.h | 4 +
arch/arm/mach-clps711x/board-cdb89712.c | 2 -
arch/arm/mach-shmobile/pm-rcar.c | 2 -
arch/arm/mm/ioremap.c | 12 +++-
arch/arm/mm/nommu.c | 11 ++-
arch/arm64/Kconfig | 1
arch/arm64/include/asm/acpi.h | 10 +--
arch/arm64/include/asm/dmi.h | 8 +--
arch/arm64/include/asm/io.h | 8 ++-
arch/arm64/kernel/efi.c | 9 ++-
arch/arm64/kernel/smp_spin_table.c | 19 +++---
arch/arm64/mm/ioremap.c | 20 ++----
arch/avr32/include/asm/io.h | 1
arch/frv/Kconfig | 1
arch/frv/include/asm/io.h | 17 ++---
arch/frv/mm/kmap.c | 6 ++
arch/ia64/Kconfig | 1
arch/ia64/include/asm/io.h | 11 +++
arch/ia64/kernel/cyclone.c | 2 -
arch/m32r/include/asm/io.h | 1
arch/m68k/Kconfig | 1
arch/m68k/include/asm/io_mm.h | 14 +---
arch/m68k/include/asm/io_no.h | 12 ++--
arch/m68k/include/asm/raw_io.h | 4 +
arch/m68k/mm/kmap.c | 17 +++++
arch/m68k/mm/sun3kmap.c | 6 ++
arch/metag/include/asm/io.h | 3 -
arch/microblaze/include/asm/io.h | 1
arch/mn10300/include/asm/io.h | 1
arch/nios2/include/asm/io.h | 1
arch/powerpc/kernel/pci_of_scan.c | 2 -
arch/s390/include/asm/io.h | 1
arch/sh/Kconfig | 1
arch/sh/include/asm/io.h | 20 ++++--
arch/sh/mm/ioremap.c | 10 +++
arch/sparc/include/asm/io_32.h | 1
arch/sparc/include/asm/io_64.h | 1
arch/sparc/kernel/pci.c | 3 -
arch/tile/include/asm/io.h | 1
arch/x86/Kconfig | 1
arch/x86/include/asm/efi.h | 3 +
arch/x86/include/asm/io.h | 17 +++--
arch/x86/kernel/crash_dump_64.c | 6 +-
arch/x86/kernel/kdebugfs.c | 8 +--
arch/x86/kernel/ksysfs.c | 28 ++++-----
arch/x86/mm/ioremap.c | 76 ++++++++++--------------
arch/xtensa/Kconfig | 1
arch/xtensa/include/asm/io.h | 9 ++-
drivers/acpi/apei/einj.c | 9 ++-
drivers/acpi/apei/erst.c | 6 +-
drivers/acpi/nvs.c | 6 +-
drivers/acpi/osl.c | 70 ++++++----------------
drivers/char/toshiba.c | 2 -
drivers/firmware/google/memconsole.c | 7 +-
drivers/gpu/drm/gma500/opregion.c | 2 -
drivers/gpu/drm/i915/intel_opregion.c | 2 -
drivers/iommu/intel-iommu.c | 10 ++-
drivers/iommu/intel_irq_remapping.c | 4 +
drivers/isdn/icn/icn.h | 2 -
drivers/mtd/devices/slram.c | 2 -
drivers/mtd/maps/pxa2xx-flash.c | 4 +
drivers/mtd/nand/diskonchip.c | 2 -
drivers/mtd/onenand/generic.c | 2 -
drivers/nvdimm/Kconfig | 2 -
drivers/pci/probe.c | 3 -
drivers/pnp/manager.c | 2 -
drivers/scsi/aic94xx/aic94xx_init.c | 7 --
drivers/scsi/arcmsr/arcmsr_hba.c | 5 --
drivers/scsi/mvsas/mv_init.c | 15 +----
drivers/scsi/sun3x_esp.c | 2 -
drivers/sfi/sfi_core.c | 4 +
drivers/staging/comedi/drivers/ii_pci20kc.c | 1
drivers/staging/unisys/visorbus/visorchannel.c | 16 +++--
drivers/staging/unisys/visorbus/visorchipset.c | 17 +++--
drivers/tty/serial/8250/8250_core.c | 2 -
drivers/video/fbdev/Kconfig | 2 -
drivers/video/fbdev/amifb.c | 5 +-
drivers/video/fbdev/atafb.c | 5 +-
drivers/video/fbdev/hpfb.c | 6 +-
drivers/video/fbdev/ocfb.c | 1
drivers/video/fbdev/s1d13xxxfb.c | 3 -
drivers/video/fbdev/stifb.c | 1
include/acpi/acpi_io.h | 6 +-
include/asm-generic/io.h | 8 ---
include/asm-generic/iomap.h | 4 -
include/linux/io-mapping.h | 2 -
include/linux/io.h | 9 +++
include/linux/mtd/map.h | 2 -
include/linux/pmem.h | 26 +++++---
include/video/vga.h | 2 -
kernel/Makefile | 2 +
kernel/memremap.c | 74 +++++++++++++++++++++++
kernel/resource.c | 43 +++++++-------
lib/Kconfig | 5 +-
lib/devres.c | 13 +---
lib/pci_iomap.c | 7 +-
tools/testing/nvdimm/Kbuild | 4 +
tools/testing/nvdimm/test/iomap.c | 34 ++++++++---
101 files changed, 482 insertions(+), 398 deletions(-)
create mode 100644 kernel/memremap.c
4 years, 10 months
kexec, x86: Need a new e820 type support for kexec
by Toshi Kani
Hello,
ACPI 6.0 defines a new type in e820, AddressRangePersistentMemory (7), for
NVDIMM. On a system with NVDIMM, kexec displays the following error
message and sets it to RANGE_RESERVED as the fallback type.
Unknown type (Persistent Memory) while parsing
/sys/firmware/memmap/34/type. Please report this as bug. Using
RANGE_RESERVED now.
This new type is defined in "arch/x86/include/uapi/asm/e820.h" in 4.2-rc1
as follows.
#define E820_PMEM 7
kexec needs to know this new type, but I think its build env includes
"/usr/include/asm/e820.h", which is provided by a distribution. On Fedora
22, kernel-headers-4.0.6-300.fc22.x86_64 is the latest kernel header
package and it will take a while for 4.2 headers.
How do we handle such kernel header dependency in the kexec build env?
Thanks,
-Toshi
5 years, 6 months
[PATCH v4 0/9] introduce __pfn_t, evacuate struct page from sgls
by Dan Williams
Introduce __pfn_t which:
1/ Allows kernel internal DAX mappings to adhere to the lifetime of the
the underlying block device. In general, it enables a mechanism to
allow any device driver to advertise "device memory" (CONFIG_DEV_PFN)
to other parts of the kernel.
2/ Replaces usage of struct page in struct scatterlist. A scatterlist
need only carry enough information to generate a dma address, and
removing struct page from scatterlists is a precursor to allowing DMA to
device memory. Some dma mapping implementations are not ready for a
scatterlist-pfn to reference unampped device memory, those
implementations are disabled by CONFIG_DEV_PFN=y.
Changes since v4 [1]:
1/ Drop the bio_vec conversion of struct page to __pfn_t for now. Wait
until there's a hierarchical block driver that would make use of direct
dma to pmem. (Christoph)
2/ Reorder the patch set to put the dax fixes first.
3/ Unconditionally convert struct scatterlist to use a pfn. Strictly
speaking the scatterlist conversion could also be deferred until we have
a driver that attempts dma to pmem, but struct scatterlist really has no
valid reason to carry a struct page. (Christoph)
4/ Rebased on block.git/for-next
---
Dan Williams (9):
introduce __pfn_t for scatterlists and pmem
x86: support kmap_atomic_pfn_t() for persistent memory
dax: drop size parameter to ->direct_access()
dax: fix mapping lifetime handling, convert to __pfn_t + kmap_atomic_pfn_t()
dma-mapping: allow archs to optionally specify a ->map_pfn() operation
scatterlist: use sg_phys()
scatterlist: cleanup sg_chain() and sg_unmark_end()
scatterlist: convert to __pfn_t
x86: convert dma_map_ops to support mapping a __pfn_t.
arch/Kconfig | 6 +
arch/arm/mm/dma-mapping.c | 2
arch/microblaze/kernel/dma.c | 2
arch/powerpc/sysdev/axonram.c | 26 ++++--
arch/x86/Kconfig | 7 ++
arch/x86/kernel/amd_gart_64.c | 22 ++++-
arch/x86/kernel/pci-nommu.c | 22 ++++-
arch/x86/kernel/pci-swiotlb.c | 4 +
arch/x86/pci/sta2x11-fixup.c | 4 +
block/blk-merge.c | 2
drivers/block/brd.c | 9 --
drivers/block/pmem.c | 16 +++
drivers/crypto/omap-sham.c | 2
drivers/dma/imx-dma.c | 8 --
drivers/dma/ste_dma40.c | 5 -
drivers/iommu/amd_iommu.c | 21 +++--
drivers/iommu/intel-iommu.c | 26 ++++--
drivers/iommu/iommu.c | 2
drivers/mmc/card/queue.c | 4 -
drivers/pci/Kconfig | 2
drivers/s390/block/dcssblk.c | 26 +++++-
drivers/staging/android/ion/ion_chunk_heap.c | 4 -
fs/block_dev.c | 4 -
fs/dax.c | 62 +++++++++++--
include/asm-generic/dma-mapping-common.h | 30 +++++++
include/asm-generic/memory_model.h | 1
include/asm-generic/pfn.h | 120 ++++++++++++++++++++++++++
include/crypto/scatterwalk.h | 9 --
include/linux/blkdev.h | 7 +-
include/linux/dma-debug.h | 23 ++++-
include/linux/dma-mapping.h | 8 ++
include/linux/highmem.h | 23 +++++
include/linux/mm.h | 1
include/linux/scatterlist.h | 103 ++++++++++++++++------
include/linux/swiotlb.h | 4 +
init/Kconfig | 13 +++
lib/dma-debug.c | 10 +-
lib/swiotlb.c | 20 +++-
mm/Makefile | 1
mm/pfn.c | 98 +++++++++++++++++++++
samples/kfifo/dma-example.c | 8 +-
41 files changed, 626 insertions(+), 141 deletions(-)
create mode 100644 include/asm-generic/pfn.h
create mode 100644 mm/pfn.c
5 years, 7 months
[PATCH v3 00/24] replace ioremap_{cache|wt} with memremap
by Dan Williams
Changes since v2 [1]:
1/ Move arch_memremap() and arch_memunmap() out of line (Christoph)
2/ Convert region_is_ram() to region_intersects() and define an enum for
its 3 return values. (Luis)
3/ Fix gma500 and i915 to explicitly use cached mappings and clean up
the __iomem usage. (Daniel)
4/ Kill unused ioremap aliases (ioremap_cached() and
ioremap_fullcache()) (Christoph)
5/ Clarify some change logs and documentation (Luis, Christoph, and
Ross)
6/ Add a unified CONFIG_MMU=n implementation with __weak symbols. (Luis)
---
While developing the pmem driver we noticed that the __iomem annotation
on the return value from ioremap_cache() was being mishandled by several
callers. We also observed that all of the call sites expected to be
able to treat the return value from ioremap_cache() as normal
(non-__iomem) pointer to memory.
This patchset takes the opportunity to clean up the above confusion as
well as a few issues with the ioremap_{cache|wt} interface, including:
1/ Eliminating the possibility of function prototypes differing between
architectures by defining a central memremap() prototype that takes
flags to determine the mapping type.
2/ Returning NULL rather than falling back silently to a different
mapping-type. This allows drivers to be stricter about the
mapping-type fallbacks that are permissible.
[1]: http://marc.info/?l=linux-arch&m=143779222217405&w=2
---
Dan Williams (24):
mm: enhance region_is_ram() to region_intersects()
arch, drivers: don't include <asm/io.h> directly, use <linux/io.h> instead
cleanup IORESOURCE_CACHEABLE vs ioremap()
intel_iommu: fix leaked ioremap mapping
arch: introduce memremap()
arm: switch from ioremap_cache to memremap
x86: switch from ioremap_cache to memremap
gma500: switch from acpi_os_ioremap to memremap
i915: switch from acpi_os_ioremap to memremap
acpi: switch from ioremap_cache to memremap
toshiba laptop: replace ioremap_cache with ioremap
memconsole: fix __iomem mishandling, switch to memremap
visorbus: switch from ioremap_cache to memremap
intel-iommu: switch from ioremap_cache to memremap
libnvdimm, pmem: push call to ioremap_cache out of line
pxa2xx-flash: switch from ioremap_cache to memremap
sfi: switch from ioremap_cache to memremap
fbdev: switch from ioremap_wt to memremap
pmem: switch from ioremap_wt to memremap
arch: kill ioremap_cached()
arch: kill ioremap_fullcache()
arch: remove ioremap_cache, replace with arch_memremap
arch: remove ioremap_wt, optionally replace with arch_memremap
pmem: convert to generic memremap
Documentation/x86/pat.txt | 6 +
arch/arc/include/asm/io.h | 1
arch/arm/Kconfig | 1
arch/arm/include/asm/io.h | 7 --
arch/arm/include/asm/xen/page.h | 4 -
arch/arm/mach-clps711x/board-cdb89712.c | 2
arch/arm/mach-shmobile/pm-rcar.c | 2
arch/arm/mm/ioremap.c | 18 +++-
arch/arm/mm/mmu.c | 2
arch/arm/mm/nommu.c | 11 ++
arch/arm64/Kconfig | 1
arch/arm64/include/asm/acpi.h | 11 --
arch/arm64/include/asm/dmi.h | 8 +-
arch/arm64/include/asm/io.h | 2
arch/arm64/kernel/efi.c | 9 +-
arch/arm64/kernel/smp_spin_table.c | 19 ++--
arch/arm64/mm/ioremap.c | 20 ++--
arch/avr32/include/asm/io.h | 1
arch/frv/include/asm/io.h | 12 ---
arch/ia64/Kconfig | 1
arch/ia64/include/asm/io.h | 5 -
arch/ia64/kernel/cyclone.c | 2
arch/ia64/mm/ioremap.c | 16 +++
arch/m32r/include/asm/io.h | 1
arch/m68k/Kconfig | 1
arch/m68k/include/asm/io_mm.h | 12 ---
arch/m68k/include/asm/io_no.h | 11 --
arch/m68k/include/asm/raw_io.h | 1
arch/m68k/mm/kmap.c | 17 +++-
arch/m68k/mm/sun3kmap.c | 6 +
arch/metag/include/asm/io.h | 6 -
arch/microblaze/include/asm/io.h | 2
arch/mn10300/include/asm/io.h | 1
arch/nios2/include/asm/io.h | 1
arch/powerpc/kernel/pci_of_scan.c | 2
arch/s390/include/asm/io.h | 1
arch/sh/Kconfig | 1
arch/sh/include/asm/io.h | 6 -
arch/sh/mm/ioremap.c | 15 +++
arch/sparc/include/asm/io_32.h | 1
arch/sparc/include/asm/io_64.h | 1
arch/sparc/kernel/pci.c | 3 -
arch/tile/include/asm/io.h | 2
arch/unicore32/include/asm/io.h | 4 -
arch/unicore32/mm/ioremap.c | 8 --
arch/x86/Kconfig | 1
arch/x86/include/asm/efi.h | 3 -
arch/x86/include/asm/io.h | 11 --
arch/x86/kernel/crash_dump_64.c | 6 +
arch/x86/kernel/kdebugfs.c | 8 +-
arch/x86/kernel/ksysfs.c | 28 +++---
arch/x86/mm/ioremap.c | 59 +++++++------
arch/xtensa/include/asm/io.h | 11 --
drivers/acpi/apei/einj.c | 9 +-
drivers/acpi/apei/erst.c | 6 +
drivers/acpi/nvs.c | 6 +
drivers/acpi/osl.c | 70 ++++-----------
drivers/char/toshiba.c | 2
drivers/firmware/google/memconsole.c | 7 +-
drivers/gpu/drm/gma500/opregion.c | 8 +-
drivers/gpu/drm/gma500/psb_drv.h | 2
drivers/gpu/drm/gma500/psb_lid.c | 8 +-
drivers/gpu/drm/i915/i915_debugfs.c | 2
drivers/gpu/drm/i915/i915_drv.h | 12 +--
drivers/gpu/drm/i915/intel_bios.c | 7 +-
drivers/gpu/drm/i915/intel_opregion.c | 87 +++++++++----------
drivers/gpu/drm/i915/intel_panel.c | 2
drivers/iommu/intel-iommu.c | 10 +-
drivers/iommu/intel_irq_remapping.c | 4 +
drivers/isdn/icn/icn.h | 2
drivers/mtd/devices/slram.c | 2
drivers/mtd/maps/pxa2xx-flash.c | 4 -
drivers/mtd/nand/diskonchip.c | 2
drivers/mtd/onenand/generic.c | 2
drivers/nvdimm/Kconfig | 2
drivers/pci/probe.c | 3 -
drivers/pnp/manager.c | 2
drivers/scsi/aic94xx/aic94xx_init.c | 7 --
drivers/scsi/arcmsr/arcmsr_hba.c | 5 -
drivers/scsi/mvsas/mv_init.c | 15 +--
drivers/scsi/sun3x_esp.c | 2
drivers/sfi/sfi_core.c | 4 -
drivers/staging/comedi/drivers/ii_pci20kc.c | 1
drivers/staging/unisys/visorbus/visorchannel.c | 16 ++-
drivers/staging/unisys/visorbus/visorchipset.c | 17 ++--
drivers/tty/serial/8250/8250_core.c | 2
drivers/video/fbdev/Kconfig | 2
drivers/video/fbdev/amifb.c | 5 +
drivers/video/fbdev/atafb.c | 5 +
drivers/video/fbdev/hpfb.c | 6 +
drivers/video/fbdev/ocfb.c | 1
drivers/video/fbdev/s1d13xxxfb.c | 3 -
drivers/video/fbdev/stifb.c | 1
include/acpi/acpi_io.h | 6 -
include/asm-generic/io.h | 8 --
include/asm-generic/iomap.h | 4 -
include/linux/io-mapping.h | 2
include/linux/io.h | 11 ++
include/linux/mm.h | 9 ++
include/linux/mtd/map.h | 2
include/linux/pmem.h | 26 +++---
include/video/vga.h | 2
kernel/Makefile | 2
kernel/memremap.c | 110 ++++++++++++++++++++++++
kernel/resource.c | 61 ++++++++-----
lib/Kconfig | 5 +
lib/devres.c | 13 +--
lib/pci_iomap.c | 7 --
tools/testing/nvdimm/Kbuild | 4 -
tools/testing/nvdimm/test/iomap.c | 34 +++++--
110 files changed, 553 insertions(+), 497 deletions(-)
create mode 100644 kernel/memremap.c
5 years, 7 months
[PATCH] nvdimm: fix inline function return type warning
by Randy Dunlap
From: Randy Dunlap <rdunlap(a)infradead.org>
Fix multiple build warnings when CONFIG_BTT is not enabled:
In file included from ../drivers/nvdimm/bus.c:29:0:
../drivers/nvdimm/nd.h:169:15: warning: return type defaults to 'int' [-Wreturn-type]
static inline nd_btt_probe(struct nd_namespace_common *ndns, void *drvdata)
^
Signed-off-by: Randy Dunlap <rdunlap(a)infradead.org>
Cc: Dan Williams <dan.j.williams(a)intel.com>
Cc: linux-nvdimm(a)lists.01.org
---
drivers/nvdimm/nd.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- lnx-42-rc4.orig/drivers/nvdimm/nd.h
+++ lnx-42-rc4/drivers/nvdimm/nd.h
@@ -166,7 +166,7 @@ int nd_btt_probe(struct nd_namespace_com
bool is_nd_btt(struct device *dev);
struct device *nd_btt_create(struct nd_region *nd_region);
#else
-static inline nd_btt_probe(struct nd_namespace_common *ndns, void *drvdata)
+static inline int nd_btt_probe(struct nd_namespace_common *ndns, void *drvdata)
{
return -ENODEV;
}
5 years, 7 months
[PATCH v2 0/3] BTT: Updates for parent_uuid handling
by Vishal Verma
Updates since v1:
- Improve patch ordering (Dan)
- Use a bool return type for is_*() routines (Dan)
- Improve readability for positive cases for !<exp> vs exp == 0 (Dan)
- Move nd_dev_to_uuid() to drivers/nvdimm/namespace_devs.c so we can avoid
making is_namespace_* helpers public.
The parent_uuid field in the BTT info block holds the UUID of the
containing namespace, and is meant to invalidate BTTs when a namespace
is re-created with a new UUID. IO namespaces, and and BTTs created before
these patches will have a parent_uuid field of '0', and will not be
automatically invalidated. They will have to force the namespace into raw
mode, and overwrite the BTT info blocks manually.
Vishal Verma (3):
libnvdimm, btt: clean up internal interfaces
libnvdimm, btt: consolidate arena validation
libnvdimm, btt: write and validate parent_uuid
drivers/nvdimm/btt.c | 39 ++++++-----------------------
drivers/nvdimm/btt.h | 3 +++
drivers/nvdimm/btt_devs.c | 55 ++++++++++++++++++++++++++++++++++-------
drivers/nvdimm/namespace_devs.c | 20 +++++++++++++++
drivers/nvdimm/nd.h | 1 +
5 files changed, 77 insertions(+), 41 deletions(-)
--
2.4.3
5 years, 7 months
[ndctl PATCH 0/4] Fixes for blk namespace seed creation
by Dan Williams
v4.2-rc4 of the kernel includes a fix (commit 8ca243536d21 libnvdimm:
fix namespace seed creation) to address the fact that kernel fails to
emit a new seed namespace after the former seed is consumed by a BTT
instance.
While writing the unit test to cover this condition it was also
discovered that libndctl is failing to rescan for new namespaces after
ndctl_btt_enable().
These patches have been verified against the latest libnvdimm-for-next
(60e95f43fc85 nfit: Don't check _STA on NVDIMM devices).
A miscellaneous fix for uninitialized variable warnings is thrown in for
good measure.
---
Dan Williams (3):
ndctl: test blk namespace seed creation
ndctl: fix uninitialized variable warnings
ndctl: refresh namespaces after btt enable
builtin-zero-labels.c | 2 +
lib/libndctl.c | 22 ++++++++++------
lib/test-libndctl.c | 68 +++++++++++++++++++++++++++++++++++++++----------
3 files changed, 69 insertions(+), 23 deletions(-)
5 years, 7 months
[GIT PULL] libnvdimm fix for 4.2-rc4
by Williams, Dan J
Hi Linus, please pull from...
git://git.kernel.org/pub/scm/linux/kernel/git/djbw/nvdimm libnvdimm-fixes
...to receive a minor fix for the libnvdimm subsystem.
This is not critical. The problem can be worked around in userspace by
putting the namespace temporarily into raw mode
(ndctl_namespace_set_raw_mode() from libndctl), but that is awkward for
management utilities. I would consider it a candidate for 4.2-stable if
it does not make 4.2.
The following changes since commit 52721d9d3334c1cb1f76219a161084094ec634dc:
Linux 4.2-rc3 (2015-07-19 14:45:02 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/djbw/nvdimm libnvdimm-fixes
for you to fetch changes up to 8ca243536d21ae2d08f61b1c5af4ac3d4bb697e4:
libnvdimm: fix namespace seed creation (2015-07-25 09:57:56 -0700)
----------------------------------------------------------------
Dan Williams (1):
libnvdimm: fix namespace seed creation
drivers/nvdimm/region_devs.c | 5 +++++
1 file changed, 5 insertions(+)
commit 8ca243536d21ae2d08f61b1c5af4ac3d4bb697e4
Author: Dan Williams <dan.j.williams(a)intel.com>
Date: Fri Jul 24 23:42:34 2015 -0400
libnvdimm: fix namespace seed creation
A new BLK namespace "seed" device is created whenever the current seed
is successfully probed. However, if that namespace is assigned to a BTT
it may never directly experience a successful probe as it is a
subordinate device to a BTT configuration.
The effect of the current code is that no new namespaces can be
instantiated, after the seed namespace, to consume available BLK DPA
capacity. Fix this by treating a successful BTT probe event as a
successful probe event for the backing namespace.
Reported-by: Nicholas Moulin <nicholas.w.moulin(a)linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c
index a5233422f9dc..7384455792bf 100644
--- a/drivers/nvdimm/region_devs.c
+++ b/drivers/nvdimm/region_devs.c
@@ -458,10 +458,15 @@ static void nd_region_notify_driver_action(struct nvdimm_bus *nvdimm_bus,
nvdimm_bus_unlock(dev);
}
if (is_nd_btt(dev) && probe) {
+ struct nd_btt *nd_btt = to_nd_btt(dev);
+
nd_region = to_nd_region(dev->parent);
nvdimm_bus_lock(dev);
if (nd_region->btt_seed == dev)
nd_region_create_btt_seed(nd_region);
+ if (nd_region->ns_seed == &nd_btt->ndns->dev &&
+ is_nd_blk(dev->parent))
+ nd_region_create_blk_seed(nd_region);
nvdimm_bus_unlock(dev);
}
}
5 years, 7 months
[PATCH] libnvdimm: fix namespace seed creation
by Dan Williams
A new BLK namespace "seed" device is created whenever the current seed
is successfully probed. However, if that namespace is assigned to a BTT
it may never directly experience a successful probe as it is a
subordinate device to a BTT configuration.
The effect of the current code is that no new namespaces can be
instantiated, after the seed namespace, to consume available BLK DPA
capacity. Fix this by treating a successful BTT probe event as a
successful probe event for the backing namespace.
Reported-by: Nicholas Moulin <nicholas.w.moulin(a)linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams(a)intel.com>
---
drivers/nvdimm/region_devs.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c
index a5233422f9dc..7384455792bf 100644
--- a/drivers/nvdimm/region_devs.c
+++ b/drivers/nvdimm/region_devs.c
@@ -458,10 +458,15 @@ static void nd_region_notify_driver_action(struct nvdimm_bus *nvdimm_bus,
nvdimm_bus_unlock(dev);
}
if (is_nd_btt(dev) && probe) {
+ struct nd_btt *nd_btt = to_nd_btt(dev);
+
nd_region = to_nd_region(dev->parent);
nvdimm_bus_lock(dev);
if (nd_region->btt_seed == dev)
nd_region_create_btt_seed(nd_region);
+ if (nd_region->ns_seed == &nd_btt->ndns->dev &&
+ is_nd_blk(dev->parent))
+ nd_region_create_blk_seed(nd_region);
nvdimm_bus_unlock(dev);
}
}
5 years, 7 months
[PATCH 0/3] BTT: Updates for parent_uuid handling
by Vishal Verma
The parent_uuid field in the BTT info block holds the UUID of the
containing namespace, and is meant to invalidate BTTs when a namespace
is re-created with a new UUID. IO namespaces, and and BTTs created before
these patches will have a parent_uuid field of '0', and will not be
automatically invalidated. They will have to force the namespace into raw
mode, and overwrite the BTT info blocks manually.
Vishal Verma (3):
libnvdimm, btt: clean up internal interfaces
libnvdimm, btt: write and validate parent_uuid
libnvdimm, btt: consolidate arena validation
drivers/nvdimm/btt.c | 39 ++++++-----------------------
drivers/nvdimm/btt.h | 3 +++
drivers/nvdimm/btt_devs.c | 55 ++++++++++++++++++++++++++++++++++-------
drivers/nvdimm/core.c | 20 +++++++++++++++
drivers/nvdimm/namespace_devs.c | 6 ++---
drivers/nvdimm/nd-core.h | 3 +++
drivers/nvdimm/nd.h | 1 +
7 files changed, 83 insertions(+), 44 deletions(-)
--
2.4.3
5 years, 7 months