pmem, nfit: Fix ARCH_MEMREMAP_PMEM handling on x86_32
Subsystems (2)
PATCH 1/1 pmem, nfit: Fix ARCH_MEMREMAP_PMEM handling on x86_32
ARCH_MEMREMAP_PMEM is defined on x86_64 only per ARCH_HAS_PMEM_API. The following compile error in __nfit_spa_map() was observed on x86_32 as it refers ARCH_MEMREMAP_PMEM without #ifdef.
drivers/acpi/nfit.c:1205:8: error: 'ARCH_MEMREMAP_PMEM' undeclared (first use in this function)
Fix it by defining ARCH_MEMREMAP_PMEM to MEMREMAP_WT in <linux/pmem.h> when CONFIG_ARCH_HAS_PMEM_API is not set, i.e. x86_32.
Remove '#ifdef ARCH_MEMREMAP_PMEM's that are no longer necessary with this change.
Also remove the redundant definition of ARCH_MEMREMAP_PMEM in <asm/pmem.h>.
----
Apply on top of libnvdimm-for-next of the nvdimm tree.
--- arch/x86/include/asm/pmem.h | 2 -- drivers/nvdimm/namespace_devs.c | 4 ---- include/linux/pmem.h | 6 +----- 3 files changed, 1 insertion(+), 11 deletions(-)
arch/x86/include/asm/pmem.h +0 -2
@@ -18,8 +18,6 @@#include <asm/cpufeature.h> #include <asm/special_insns.h> -#define ARCH_MEMREMAP_PMEM MEMREMAP_WB -#ifdef CONFIG_ARCH_HAS_PMEM_API #define ARCH_MEMREMAP_PMEM MEMREMAP_WB/**
drivers/nvdimm/namespace_devs.c +0 -4
@@ -90,11 +90,7 @@ bool pmem_should_map_pages(struct device *dev)if (is_nd_pfn (dev) ||is_nd_btt (dev))return false; -#ifdef ARCH_MEMREMAP_PMEM return ARCH_MEMREMAP_PMEM ==MEMREMAP_WB ; -#else -return false; -#endif }EXPORT_SYMBOL (pmem_should_map_pages);
include/linux/pmem.h +1 -5
@@ -19,6 +19,7 @@#ifdef CONFIG_ARCH_HAS_PMEM_API #include <asm/pmem.h> #else +#define ARCH_MEMREMAP_PMEM MEMREMAP_WT/* * These are simply here to enable compilation, all call sites gate * calling these symbols with arch_has_pmem_api() and redirect to the
@@ -129,13 +130,8 @@ static inline void default_clear_pmem(void __pmem *addr, size_t size) static inline void __pmem *memremap_pmem(struct device *dev,resource_size_t offset,unsigned long size) { -#ifdef ARCH_MEMREMAP_PMEM return (void __pmem *) devm_memremap(dev, offset, size,ARCH_MEMREMAP_PMEM ); -#else - return (void __pmem *) devm_memremap(dev, offset, size, -MEMREMAP_WT ); -#endif }/**
Quoted 16 lines · Toshi Kani
ARCH_MEMREMAP_PMEMis defined onx86_64only perARCH_HAS_PMEM_API. The following compile error in__nfit_spa_map()was observed onx86_32as it refersARCH_MEMREMAP_PMEMwithout #ifdef.
drivers/acpi/nfit.c:1205:8: error: 'ARCH_MEMREMAP_PMEM' undeclared (first use in this function)Fix it by defining
ARCH_MEMREMAP_PMEMtoMEMREMAP_WTin <linux/pmem.h> whenCONFIG_ARCH_HAS_PMEM_APIis not set, i.e.x86_32.Remove '#ifdef ARCH_MEMREMAP_PMEM's that are no longer necessary with this change.
Also remove the redundant definition of
ARCH_MEMREMAP_PMEMin <asm/pmem.h>.
Quoted 6 lines
Signed-off-by Toshi Kani <[email protected]>Cc Dan Williams <[email protected]>Cc Ross Zwisler <[email protected]>Cc Christoph Hellwig <[email protected]>----
Apply on top of libnvdimm-for-next of the nvdimm tree.
Thanks Toshi, I'll fold this in to prevent bisection breakage.