* [obsolete] s390-mm-convert-to-generic_ioremap.patch removed from -mm tree
@ 2023-07-09 0:38 Andrew Morton
2023-07-09 2:26 ` Baoquan He
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Morton @ 2023-07-09 0:38 UTC (permalink / raw)
To: mm-commits, ysato, willy, will, wangkefeng.wang, vgupta, svens,
stefan.kristiansson, shorne, schnelle, rppt, npiggin, nathan, mpe,
jonas, jcmvbkbc, James.Bottomley, hch, hca, gor, glaubitz,
gerald.schaefer, geert, deller, David.Laight, dalias, chris,
christophe.leroy, catalin.marinas, borntraeger, bcain, arnd,
agordeev, bhe, akpm
The quilt patch titled
Subject: s390: mm: convert to GENERIC_IOREMAP
has been removed from the -mm tree. Its filename was
s390-mm-convert-to-generic_ioremap.patch
This patch was dropped because it is obsolete
------------------------------------------------------
From: Baoquan He <bhe@redhat.com>
Subject: s390: mm: convert to GENERIC_IOREMAP
Date: Thu, 6 Jul 2023 23:45:11 +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() and iounmap() for s390's
special operation when ioremap() and iounmap().
And also replace including <asm-generic/io.h> with <asm/io.h> in
arch/s390/kernel/perf_cpum_sf.c, otherwise building error will be seen
because macro defined in <asm/io.h> can't be seen in perf_cpum_sf.c.
Link: https://lkml.kernel.org/r/20230706154520.11257-11-bhe@redhat.com
Signed-off-by: Baoquan He <bhe@redhat.com>
Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mike Rapoport (IBM) <rppt@kernel.org>
Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Brian Cain <bcain@quicinc.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Chris Zankel <chris@zankel.net>
Cc: David Laight <David.Laight@ACULAB.COM>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Helge Deller <deller@gmx.de>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Rich Felker <dalias@libc.org>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Cc: Vineet Gupta <vgupta@kernel.org>
Cc: Will Deacon <will@kernel.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
arch/s390/Kconfig | 1
arch/s390/include/asm/io.h | 21 ++++++-----
arch/s390/kernel/perf_cpum_sf.c | 2 -
arch/s390/pci/pci.c | 57 +++++-------------------------
4 files changed, 24 insertions(+), 57 deletions(-)
--- a/arch/s390/include/asm/io.h~s390-mm-convert-to-generic_ioremap
+++ a/arch/s390/include/asm/io.h
@@ -22,11 +22,18 @@ void unxlate_dev_mem_ptr(phys_addr_t phy
#define IO_SPACE_LIMIT 0
-void __iomem *ioremap_prot(phys_addr_t addr, size_t size, unsigned long prot);
-void __iomem *ioremap(phys_addr_t addr, size_t size);
-void __iomem *ioremap_wc(phys_addr_t addr, size_t size);
-void __iomem *ioremap_wt(phys_addr_t addr, size_t size);
-void iounmap(volatile void __iomem *addr);
+/*
+ * I/O memory mapping functions.
+ */
+#define ioremap_prot ioremap_prot
+#define iounmap iounmap
+
+#define _PAGE_IOREMAP pgprot_val(PAGE_KERNEL)
+
+#define ioremap_wc(addr, size) \
+ ioremap_prot((addr), (size), pgprot_val(pgprot_writecombine(PAGE_KERNEL)))
+#define ioremap_wt(addr, size) \
+ ioremap_prot((addr), (size), pgprot_val(pgprot_writethrough(PAGE_KERNEL)))
static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
{
@@ -51,10 +58,6 @@ static inline void ioport_unmap(void __i
#define pci_iomap_wc pci_iomap_wc
#define pci_iomap_wc_range pci_iomap_wc_range
-#define ioremap ioremap
-#define ioremap_wt ioremap_wt
-#define ioremap_wc ioremap_wc
-
#define memcpy_fromio(dst, src, count) zpci_memcpy_fromio(dst, src, count)
#define memcpy_toio(dst, src, count) zpci_memcpy_toio(dst, src, count)
#define memset_io(dst, val, count) zpci_memset_io(dst, val, count)
--- a/arch/s390/Kconfig~s390-mm-convert-to-generic_ioremap
+++ a/arch/s390/Kconfig
@@ -143,6 +143,7 @@ config S390
select GENERIC_SMP_IDLE_THREAD
select GENERIC_TIME_VSYSCALL
select GENERIC_VDSO_TIME_NS
+ select GENERIC_IOREMAP if PCI
select HAVE_ALIGNED_STRUCT_PAGE if SLUB
select HAVE_ARCH_AUDITSYSCALL
select HAVE_ARCH_JUMP_LABEL
--- a/arch/s390/kernel/perf_cpum_sf.c~s390-mm-convert-to-generic_ioremap
+++ a/arch/s390/kernel/perf_cpum_sf.c
@@ -22,7 +22,7 @@
#include <asm/irq.h>
#include <asm/debug.h>
#include <asm/timex.h>
-#include <asm-generic/io.h>
+#include <asm/io.h>
/* Minimum number of sample-data-block-tables:
* At least one table is required for the sampling buffer structure.
--- a/arch/s390/pci/pci.c~s390-mm-convert-to-generic_ioremap
+++ a/arch/s390/pci/pci.c
@@ -244,62 +244,25 @@ void __iowrite64_copy(void __iomem *to,
zpci_memcpy_toio(to, from, count);
}
-static void __iomem *__ioremap(phys_addr_t addr, size_t size, pgprot_t prot)
+void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size,
+ unsigned long prot)
{
- unsigned long offset, vaddr;
- struct vm_struct *area;
- phys_addr_t last_addr;
-
- last_addr = addr + size - 1;
- if (!size || last_addr < addr)
- return NULL;
-
+ /*
+ * When PCI MIO instructions are unavailable the "physical" address
+ * encodes a hint for accessing the PCI memory space it represents.
+ * Just pass it unchanged such that ioread/iowrite can decode it.
+ */
if (!static_branch_unlikely(&have_mio))
- return (void __iomem *) addr;
-
- offset = addr & ~PAGE_MASK;
- addr &= PAGE_MASK;
- size = PAGE_ALIGN(size + offset);
- area = get_vm_area(size, VM_IOREMAP);
- if (!area)
- return NULL;
-
- vaddr = (unsigned long) area->addr;
- if (ioremap_page_range(vaddr, vaddr + size, addr, prot)) {
- free_vm_area(area);
- return NULL;
- }
- return (void __iomem *) ((unsigned long) area->addr + offset);
-}
+ return (void __iomem *)phys_addr;
-void __iomem *ioremap_prot(phys_addr_t addr, size_t size, unsigned long prot)
-{
- return __ioremap(addr, size, __pgprot(prot));
+ return generic_ioremap_prot(phys_addr, size, __pgprot(prot));
}
EXPORT_SYMBOL(ioremap_prot);
-void __iomem *ioremap(phys_addr_t addr, size_t size)
-{
- return __ioremap(addr, size, PAGE_KERNEL);
-}
-EXPORT_SYMBOL(ioremap);
-
-void __iomem *ioremap_wc(phys_addr_t addr, size_t size)
-{
- return __ioremap(addr, size, pgprot_writecombine(PAGE_KERNEL));
-}
-EXPORT_SYMBOL(ioremap_wc);
-
-void __iomem *ioremap_wt(phys_addr_t addr, size_t size)
-{
- return __ioremap(addr, size, pgprot_writethrough(PAGE_KERNEL));
-}
-EXPORT_SYMBOL(ioremap_wt);
-
void iounmap(volatile void __iomem *addr)
{
if (static_branch_likely(&have_mio))
- vunmap((__force void *) ((unsigned long) addr & PAGE_MASK));
+ generic_iounmap(addr);
}
EXPORT_SYMBOL(iounmap);
_
Patches currently in -mm which might be from bhe@redhat.com are
asm-generic-iomaph-remove-arch_has_ioremap_xx-macros.patch
hexagon-mm-convert-to-generic_ioremap.patch
openrisc-mm-remove-unneeded-early-ioremap-code.patch
mm-ioremap-allow-arch-to-have-its-own-ioremap-method-definition.patch
mm-ioremap-add-slab-availability-checking-in-ioremap_prot.patch
arc-mm-convert-to-generic_ioremap.patch
ia64-mm-convert-to-generic_ioremap.patch
openrisc-mm-convert-to-generic_ioremap.patch
sh-add-asm-generic-ioh-including.patch
sh-mm-convert-to-generic_ioremap.patch
xtensa-mm-convert-to-generic_ioremap.patch
parisc-mm-convert-to-generic_ioremap.patch
mm-move-is_ioremap_addr-into-new-header-file.patch
arm64-mm-add-wrapper-function-ioremap_prot.patch
mm-ioremap-remove-unneeded-ioremap_allowed-and-iounmap_allowed.patch
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [obsolete] s390-mm-convert-to-generic_ioremap.patch removed from -mm tree
2023-07-09 0:38 [obsolete] s390-mm-convert-to-generic_ioremap.patch removed from -mm tree Andrew Morton
@ 2023-07-09 2:26 ` Baoquan He
0 siblings, 0 replies; 2+ messages in thread
From: Baoquan He @ 2023-07-09 2:26 UTC (permalink / raw)
To: Andrew Morton
Cc: mm-commits, ysato, willy, will, wangkefeng.wang, vgupta, svens,
stefan.kristiansson, shorne, schnelle, rppt, npiggin, nathan, mpe,
jonas, jcmvbkbc, James.Bottomley, hch, hca, gor, glaubitz,
gerald.schaefer, geert, deller, David.Laight, dalias, chris,
christophe.leroy, catalin.marinas, borntraeger, bcain, arnd,
agordeev
Hi Andrew,
On 07/08/23 at 05:38pm, Andrew Morton wrote:
......
> --- a/arch/s390/kernel/perf_cpum_sf.c~s390-mm-convert-to-generic_ioremap
> +++ a/arch/s390/kernel/perf_cpum_sf.c
> @@ -22,7 +22,7 @@
> #include <asm/irq.h>
> #include <asm/debug.h>
> #include <asm/timex.h>
> -#include <asm-generic/io.h>
> +#include <asm/io.h>
Only this hunk in arch/s390/kernel/perf_cpum_sf.c is obsolete because
both below two commits have fixed the direct including of
<asm-generic/io.h> and have been merged into linus's master branch.
51f513fd9659 ("s390/mm: do not include <asm-generic/io.h> directly")
b378a9826143 ("s390: include linux/io.h instead of asm/io.h")
Other than this, the whole patch is still wanted. Do I need to remove
above hunk and repost patch s390-mm-convert-to-generic_ioremap.patch?
Thanks
Baoquan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-09 2:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-09 0:38 [obsolete] s390-mm-convert-to-generic_ioremap.patch removed from -mm tree Andrew Morton
2023-07-09 2:26 ` Baoquan He
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.