Re: [PATCH 14/26] asm-generic: don't provide __ioremap

2019-08-17 Thread Paul Walmsley
On Sat, 17 Aug 2019, Paul Walmsley wrote: > Acked-by: Paul Walmsley # arch/riscv This ack is superfluous since the patch doesn't touch arch/riscv; feel free to drop it - Paul

Re: [PATCH 24/26] riscv: use the generic ioremap code

2019-08-17 Thread Paul Walmsley
On Sat, 17 Aug 2019, Christoph Hellwig wrote: > Use the generic ioremap code instead of providing a local version. > Note that this relies on the asm-generic no-op definition of > pgprot_noncached. > > Signed-off-by: Christoph Hellwig > --- > arch/riscv/Kconfig | 1 + > arch/risc

Re: [PATCH 16/26] asm-generic: don't provide ioremap for CONFIG_MMU

2019-08-17 Thread Paul Walmsley
On Sat, 17 Aug 2019, Christoph Hellwig wrote: > All MMU-enabled ports have a non-trivial ioremap and should thus provide > the prototype for their implementation instead of providing a generic > one unless a different symbol is not defined. Note that this only > affects sparc32 nds32 as all other

Re: [PATCH 17/26] arch: rely on asm-generic/io.h for default ioremap_* definitions

2019-08-17 Thread Paul Walmsley
On Sat, 17 Aug 2019, Christoph Hellwig wrote: > Various architectures that use asm-generic/io.h still defined their > own default versions of ioremap_nocache, ioremap_wt and ioremap_wc > that point back to plain ioremap directly or indirectly. Remove these > definitions and rely on asm-generic/io

Re: [PATCH 15/26] asm-generic: ioremap_uc should behave the same with and without MMU

2019-08-17 Thread Paul Walmsley
On Sat, 17 Aug 2019, Christoph Hellwig wrote: > Whatever reason there is for the existence of ioremap_uc, and the fact > that it returns NULL by default on architectures with an MMU applies > equally to nommu architectures, so don't provide different defaults. > > In practice the difference is

Re: [PATCH 14/26] asm-generic: don't provide __ioremap

2019-08-17 Thread Paul Walmsley
On Sat, 17 Aug 2019, Christoph Hellwig wrote: > __ioremap is not a kernel API, but used for helpers with differing > semantics in arch code. We should not provide it in as-generic. > > Signed-off-by: Christoph Hellwig Reviewed-by: Paul Walmsley Tested-by: Paul Walmsley # rv32, rv64 boot Acke

Re: [PATCH 06/26] ia64: rename ioremap_nocache to ioremap_uc

2019-08-17 Thread Sergei Shtylyov
Hello! On 17.08.2019 10:32, Christoph Hellwig wrote: On ia64 ioremap_nocache fails if attributs don't match. Not other Attributes. :-) architectures does this, and we plan to get rid of ioremap_nocache. So get rid of the special semantics and define ioremap_nocache in terms of ioremap a

Re: [PATCH 12/26] x86: clean up ioremap

2019-08-17 Thread Ingo Molnar
* Christoph Hellwig wrote: > Use ioremap as the main implemented function, and defined > ioremap_nocache to it as a deprecated alias. > > Signed-off-by: Christoph Hellwig > --- > arch/x86/include/asm/io.h | 8 ++-- > arch/x86/mm/ioremap.c | 8 > arch/x86/mm/pageattr.c| 4

[PATCH 21/26] nios2: remove __iounmap

2019-08-17 Thread Christoph Hellwig
No need to indirect iounmap for nios2. Signed-off-by: Christoph Hellwig --- arch/nios2/include/asm/io.h | 7 +-- arch/nios2/mm/ioremap.c | 6 +++--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/arch/nios2/include/asm/io.h b/arch/nios2/include/asm/io.h index d108937c321e

[PATCH 24/26] riscv: use the generic ioremap code

2019-08-17 Thread Christoph Hellwig
Use the generic ioremap code instead of providing a local version. Note that this relies on the asm-generic no-op definition of pgprot_noncached. Signed-off-by: Christoph Hellwig --- arch/riscv/Kconfig | 1 + arch/riscv/include/asm/io.h | 3 -- arch/riscv/include/asm/pgtable

[PATCH 15/26] asm-generic: ioremap_uc should behave the same with and without MMU

2019-08-17 Thread Christoph Hellwig
Whatever reason there is for the existence of ioremap_uc, and the fact that it returns NULL by default on architectures with an MMU applies equally to nommu architectures, so don't provide different defaults. In practice the difference is meaningless as the only portable driver that uses ioremap_u

[PATCH 19/26] arm64: remove __iounmap

2019-08-17 Thread Christoph Hellwig
No need to indirect iounmap for arm64. Signed-off-by: Christoph Hellwig --- arch/arm64/include/asm/io.h | 3 +-- arch/arm64/mm/ioremap.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h index a61b1469f7d9..1bf5

[PATCH 18/26] m68k: rename __iounmap and mark it static

2019-08-17 Thread Christoph Hellwig
m68k uses __iounmap as the name for an internal helper that is only used for some CPU types. Mark it static and give it a better name. Signed-off-by: Christoph Hellwig --- arch/m68k/include/asm/kmap.h | 1 - arch/m68k/mm/kmap.c | 9 ++--- 2 files changed, 6 insertions(+), 4 deletio

[PATCH 23/26] lib: provide a simple generic ioremap implementation

2019-08-17 Thread Christoph Hellwig
A lot of architectures reuse the same simple ioremap implementation, so start lifting the most simple variant to lib/ioremap.c. It provides ioremap_prot and iounmap, plus a default ioremap that uses prot_noncached, although that can be overridden by asm/io.h. Signed-off-by: Christoph Hellwig ---

[PATCH 17/26] arch: rely on asm-generic/io.h for default ioremap_* definitions

2019-08-17 Thread Christoph Hellwig
Various architectures that use asm-generic/io.h still defined their own default versions of ioremap_nocache, ioremap_wt and ioremap_wc that point back to plain ioremap directly or indirectly. Remove these definitions and rely on asm-generic/io.h instead. For this to work the backup ioremap_* defi

[PATCH 22/26] sh: remove __iounmap

2019-08-17 Thread Christoph Hellwig
No need to indirect iounmap for sh. Signed-off-by: Christoph Hellwig --- arch/sh/include/asm/io.h | 9 ++--- arch/sh/mm/ioremap.c | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h index ac0561960c52..1495489225ac

[PATCH 20/26] hexagon: remove __iounmap

2019-08-17 Thread Christoph Hellwig
No need to indirect iounmap for hexagon. Signed-off-by: Christoph Hellwig --- arch/hexagon/include/asm/io.h | 7 +-- arch/hexagon/kernel/hexagon_ksyms.c | 2 +- arch/hexagon/mm/ioremap.c | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/arch/hexagon/inclu

[PATCH 26/26] nds32: use generic ioremap

2019-08-17 Thread Christoph Hellwig
Use the generic ioremap_prot and iounmap helpers. Note that the io.h include in pgtable.h had to be removed to not create an include loop. As far as I can tell there was no need for it to start with. Signed-off-by: Christoph Hellwig --- arch/nds32/Kconfig | 1 + arch/nds32/inclu

[PATCH 25/26] csky: use generic ioremap

2019-08-17 Thread Christoph Hellwig
Use the generic ioremap_prot and iounmap helpers. Signed-off-by: Christoph Hellwig --- arch/csky/Kconfig | 1 + arch/csky/include/asm/io.h | 7 -- arch/csky/include/asm/pgtable.h | 4 arch/csky/mm/ioremap.c | 42 - 4 files c

[PATCH 08/26] m68k: simplify ioremap_nocache

2019-08-17 Thread Christoph Hellwig
Just define ioremap_nocache to ioremap instead of duplicating the inline. Also defined ioremap_uc in terms of ioremap instead of the using a double indirection. Signed-off-by: Christoph Hellwig --- arch/m68k/include/asm/kmap.h | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) di

[PATCH 16/26] asm-generic: don't provide ioremap for CONFIG_MMU

2019-08-17 Thread Christoph Hellwig
All MMU-enabled ports have a non-trivial ioremap and should thus provide the prototype for their implementation instead of providing a generic one unless a different symbol is not defined. Note that this only affects sparc32 nds32 as all others do provide their own version. Also update the kernel

[PATCH 14/26] asm-generic: don't provide __ioremap

2019-08-17 Thread Christoph Hellwig
__ioremap is not a kernel API, but used for helpers with differing semantics in arch code. We should not provide it in as-generic. Signed-off-by: Christoph Hellwig --- include/asm-generic/io.h | 9 - 1 file changed, 9 deletions(-) diff --git a/include/asm-generic/io.h b/include/asm-gen

[PATCH 12/26] x86: clean up ioremap

2019-08-17 Thread Christoph Hellwig
Use ioremap as the main implemented function, and defined ioremap_nocache to it as a deprecated alias. Signed-off-by: Christoph Hellwig --- arch/x86/include/asm/io.h | 8 ++-- arch/x86/mm/ioremap.c | 8 arch/x86/mm/pageattr.c| 4 ++-- 3 files changed, 8 insertions(+), 12 del

[PATCH 13/26] xtensa: clean up ioremap

2019-08-17 Thread Christoph Hellwig
Use ioremap as the main implemented function, and defined ioremap_nocache to it as a deprecated alias. Signed-off-by: Christoph Hellwig --- arch/xtensa/include/asm/io.h | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/arch/xtensa/include/asm/io.h b/arch/xtensa/

[PATCH 11/26] parisc: remove __ioremap

2019-08-17 Thread Christoph Hellwig
__ioremap is always called with the _PAGE_NO_CACHE, so fold the whole thing and rename it to ioremap. This allows allows to remove the special EISA quirk to force _PAGE_NO_CACHE. Signed-off-by: Christoph Hellwig --- arch/parisc/include/asm/io.h | 11 +-- arch/parisc/mm/ioremap.c | 1

[PATCH 06/26] ia64: rename ioremap_nocache to ioremap_uc

2019-08-17 Thread Christoph Hellwig
On ia64 ioremap_nocache fails if attributs don't match. Not other architectures does this, and we plan to get rid of ioremap_nocache. So get rid of the special semantics and define ioremap_nocache in terms of ioremap as no portable driver could rely on the behavior anyway. However x86 implements

[PATCH 10/26] nios2: remove __ioremap

2019-08-17 Thread Christoph Hellwig
The cacheflag argument to __ioremap is always 0, so just implement ioremap directly. Signed-off-by: Christoph Hellwig --- arch/nios2/include/asm/io.h | 20 arch/nios2/mm/ioremap.c | 17 +++-- 2 files changed, 7 insertions(+), 30 deletions(-) diff --git a/arc

[PATCH 07/26] hexagon: clean up ioremap

2019-08-17 Thread Christoph Hellwig
Use ioremap as the main implemented function, and defined ioremap_nocache to it as a deprecated alias. Signed-off-by: Christoph Hellwig --- arch/hexagon/include/asm/io.h | 11 ++- arch/hexagon/kernel/hexagon_ksyms.c | 2 +- arch/hexagon/mm/ioremap.c | 2 +- 3 files chan

[PATCH 09/26] alpha: remove the unused __ioremap wrapper

2019-08-17 Thread Christoph Hellwig
No need for the additional namespace pollution. Signed-off-by: Christoph Hellwig --- arch/alpha/include/asm/io.h | 6 -- 1 file changed, 6 deletions(-) diff --git a/arch/alpha/include/asm/io.h b/arch/alpha/include/asm/io.h index af2c0063dc75..1989b946a28d 100644 --- a/arch/alpha/include/asm

[PATCH 05/26] openrisc: map as uncached in ioremap

2019-08-17 Thread Christoph Hellwig
Openrisc is the only architecture not mapping ioremap as uncached, which has been the default since the Linux 2.6.x days. Switch it over to implement uncached semantics by default. Signed-off-by: Christoph Hellwig --- arch/openrisc/include/asm/io.h | 20 +++- arch/openrisc/

[PATCH 04/26] mips: remove ioremap_cachable

2019-08-17 Thread Christoph Hellwig
Just define ioremap_cache directly. Signed-off-by: Christoph Hellwig --- arch/mips/include/asm/io.h | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index 97a280640daf..c02db986ddf5 100644 --- a/arch/mips/include/a

[PATCH 03/26] m68k, microblaze: remove ioremap_fullcache

2019-08-17 Thread Christoph Hellwig
No callers of this function. Signed-off-by: Christoph Hellwig --- arch/m68k/include/asm/kmap.h | 7 --- arch/microblaze/include/asm/io.h | 1 - 2 files changed, 8 deletions(-) diff --git a/arch/m68k/include/asm/kmap.h b/arch/m68k/include/asm/kmap.h index aac7f045f7f0..03d904fe6087 10064

[PATCH 02/26] arm, unicore32: remove ioremap_cached

2019-08-17 Thread Christoph Hellwig
No users of ioremap_cached are left, remove it. Signed-off-by: Christoph Hellwig --- arch/arm/include/asm/io.h | 6 -- arch/arm/mm/ioremap.c | 4 arch/arm/mm/mmu.c | 2 +- arch/arm/mm/nommu.c | 4 arch/unicore32/include/asm/io.h | 4 +--- a

[PATCH 01/26] mtd/maps/pxa2xx: use ioremap_cache insted of ioremap_cached

2019-08-17 Thread Christoph Hellwig
pxa2xx-flash is the only user of ioremap_cached, which is an alias for ioremap_cache anyway. Signed-off-by: Christoph Hellwig --- drivers/mtd/maps/pxa2xx-flash.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.

generic ioremap (and lots of cleanups)

2019-08-17 Thread Christoph Hellwig
Hi all, the last patches in this series add a generic ioremap implementation, and switch our 3 most recent and thus most tidy architeture ports over to use it. With a little work and an additional arch hook or two the implementation should be able to eventually cover more than half of our ports.