xtensa-mm-convert-to-generic_ioremap.patch removed from -mm tree
The quilt patch titled
Subject: xtensa: mm: convert to GENERIC_IOREMAP
has been removed from the -mm tree. Its filename was
xtensa-mm-convert-to-generic_ioremap.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Baoquan He <[email protected]>
Subject: xtensa: mm: convert to GENERIC_IOREMAP
Date: Thu, 6 Jul 2023 23:45:14 +0800
By taking GENERIC_IOREMAP method, the generic generic_ioremap_prot(), generic_iounmap(), and their generic wrapper ioremap_prot(), ioremap() and iounmap() are all visible and available to arch. Arch needs to provide wrapper functions to override the generic versions if there's arch specific handling in its ioremap_prot(), ioremap() or iounmap(). This change will simplify implementation by removing duplicated code with generic_ioremap_prot() and generic_iounmap(), and has the equivalent functioality as before.
Here, add wrapper functions ioremap_prot(), ioremap() and iounmap() for xtensa's special operation when ioremap() and iounmap().
---
arch/xtensa/Kconfig | 1 arch/xtensa/include/asm/io.h | 32 ++++++------------ arch/xtensa/mm/ioremap.c | 58 +++++++-------------------------- 3 files changed, 27 insertions(+), 64 deletions(-)
arch/xtensa/include/asm/io.h renamed from arch/xtensa/include/asm/io.h~xtensa-mm-convert-to-generic_ioremap +12 -20
@@ -16,6 +16,7 @@#include <asm/vectors.h> #include <linux/bug.h> #include <linux/kernel.h> +#include <linux/pgtable.h> #include <linux/types.h>
@@ -24,22 +25,24 @@#define PCI_IOBASE ((void __iomem *)XCHAL_KIO_BYPASS_VADDR)#ifdef CONFIG_MMU - -void __iomem *xtensa_ioremap_nocache (unsigned long addr,unsigned long size); -void __iomem *xtensa_ioremap_cache (unsigned long addr,unsigned long size); -void xtensa_iounmap (volatile void __iomem *addr); -/* -* Return the virtual address for the specified bus memory. +* I/O memory mapping functions. */ +void __iomem *ioremap_prot (phys_addr_t phys_addr,size_t size, +unsigned long prot); +#define ioremap_prot ioremap_prot +#define iounmap iounmap +static inline void __iomem *ioremap (unsigned long offset,unsigned long size) {if (offset >=XCHAL_KIO_PADDR && offset -XCHAL_KIO_PADDR <XCHAL_KIO_SIZE )return (void *)(offset-XCHAL_KIO_PADDR +XCHAL_KIO_BYPASS_VADDR );else -return xtensa_ioremap_nocache (offset, size); +return ioremap_prot (offset, size, +pgprot_val (pgprot_noncached (PAGE_KERNEL ))); } +#define ioremap ioremapstatic inline void __iomem *ioremap_cache (unsigned long offset,unsigned long size)
@@ -48,21 +51,10 @@ static inline void __iomem *ioremap_cach && offset - XCHAL_KIO_PADDR < XCHAL_KIO_SIZE)return (void *)(offset-XCHAL_KIO_PADDR +XCHAL_KIO_CACHED_VADDR ); else - return xtensa_ioremap_cache(offset, size); -} -#define ioremap_cache ioremap_cache + return ioremap_prot(offset, size, pgprot_val(PAGE_KERNEL)); -static inline void iounmap (volatile void __iomem *addr) -{ -unsigned long va = (unsigned long ) addr; - -if (!(va >=XCHAL_KIO_CACHED_VADDR && - va -XCHAL_KIO_CACHED_VADDR <XCHAL_KIO_SIZE ) && - !(va >=XCHAL_KIO_BYPASS_VADDR && - va -XCHAL_KIO_BYPASS_VADDR <XCHAL_KIO_SIZE )) -xtensa_iounmap (addr); } - +#define ioremap_cache ioremap_cache#endif /* CONFIG_MMU */ #include <asm-generic/io.h>
arch/xtensa/Kconfig renamed from arch/xtensa/Kconfig~xtensa-mm-convert-to-generic_ioremap +1 -0
@@ -28,6 +28,7 @@ config XTENSA select GENERIC_LIB_UCMPDI2 select GENERIC_PCI_IOMAP select GENERIC_SCHED_CLOCK + select GENERIC_IOREMAP if MMU select HAVE_ARCH_AUDITSYSCALL select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL select HAVE_ARCH_KASAN if MMU && !XIP_KERNEL
arch/xtensa/mm/ioremap.c renamed from arch/xtensa/mm/ioremap.c~xtensa-mm-convert-to-generic_ioremap +14 -44
74 lines not on this page · raw message
_
Patches currently in -mm which might be from [email protected] are
net-altera-tse-make-altera_tse-depend-on-has_iomem.patch irqchip-al-fic-make-al_fic-depend-on-has_iomem.patch