Re: [RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary

2021-12-31 Thread Niklas Schnelle
On Thu, 2021-12-30 at 16:44 +1300, Michael Schmitz wrote: > Hi Arnd, > > Am 30.12.2021 um 14:48 schrieb Arnd Bergmann: > > On Tue, Dec 28, 2021 at 11:15 PM Michael Schmitz > > wrote: > > > Am 29.12.2021 um 16:41 schrieb Arnd Bergmann: > > > > On Tue, Dec 28, 2021 at 8:20 PM Michael Schmitz > >

[RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary

2021-12-27 Thread Niklas Schnelle
: Arnd Bergmann Signed-off-by: Niklas Schnelle --- arch/alpha/Kconfig | 1 + arch/arc/Kconfig| 1 + arch/arm/Kconfig| 1 + arch/arm64/Kconfig | 1 + arch/ia64/Kconfig | 1 + arch/m68k/Kconfig | 1 + arch/microblaze/Kconfig | 1 + arch/mips/Kconfig | 1

[PATCH v6 2/3] risc-v: Use generic io.h helpers for nommu

2021-05-10 Thread Niklas Schnelle
From: Niklas Schnelle Without MMU support PCI_IOBASE is left undefined because PCI_IO_END is VMEMMAP_START. Nevertheless the in*()/out*() helper macros are left defined with uses of PCI_IOBASE. At the moment this only compiles because asm-generic/io.h defines PCI_IOBASE as 0 if it is undefined

[PATCH v6 3/3] asm-generic/io.h: warn in inb() and friends with undefined PCI_IOBASE

2021-05-10 Thread Niklas Schnelle
ng by letting inb() and friends fail with WARN_ONCE() and a 0xff... return in case PCI_IOBASE is not defined. Link: https://lore.kernel.org/lkml/2021042759.2059976-1-schne...@linux.ibm.com/ Signed-off-by: Niklas Schnelle --- v5 -> v6: - Added memset to insb()/insw()/insl() in WARN_ONCE()

[PATCH v6 1/3] sparc: explicitly set PCI_IOBASE to 0

2021-05-10 Thread Niklas Schnelle
Instead of relying on the fallback in asm-generic/io.h which sets PCI_IOBASE 0 if it is not defined set it explicitly. Link: https://lore.kernel.org/lkml/CAK8P3a3PK9zyeP4ymELtc2ZYnymECoACiigw9Za+pvSJpCk5=g...@mail.gmail.com/ Signed-off-by: Niklas Schnelle --- arch/sparc/include/asm/io.h | 8

[PATCH v6 0/3] asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE

2021-05-10 Thread Niklas Schnelle
t for nds32 and ARC). Changes since v1: - Added patch to explicitly set PCI_IOBASE to 0 on sparc as suggested by Arnd Bergmann - Instead of working around the warning with a uintptr_t PCI_IOBASE make inb() and friends explicitly WARN_ONCE() and return 0xff... (Arnd Bergmann) Niklas Schnel

[PATCH v5 3/3] asm-generic/io.h: warn in inb() and friends with undefined PCI_IOBASE

2021-05-10 Thread Niklas Schnelle
ng by letting inb() and friends fail with WARN_ONCE() and a 0xff... return in case PCI_IOBASE is not defined. Link: https://lore.kernel.org/lkml/2021042759.2059976-1-schne...@linux.ibm.com/ Signed-off-by: Niklas Schnelle --- include/asm-generic/io.h | 65 +-

[PATCH v5 1/3] sparc: explicitly set PCI_IOBASE to 0

2021-05-10 Thread Niklas Schnelle
Instead of relying on the fallback in asm-generic/io.h which sets PCI_IOBASE 0 if it is not defined set it explicitly. Link: https://lore.kernel.org/lkml/CAK8P3a3PK9zyeP4ymELtc2ZYnymECoACiigw9Za+pvSJpCk5=g...@mail.gmail.com/ Signed-off-by: Niklas Schnelle --- arch/sparc/include/asm/io.h | 8

[PATCH v5 2/3] risc-v: Use generic io.h helpers for nommu

2021-05-10 Thread Niklas Schnelle
From: Niklas Schnelle Without MMU support PCI_IOBASE is left undefined because PCI_IO_END is VMEMMAP_START. Nevertheless the in*()/out*() helper macros are left defined with uses of PCI_IOBASE. At the moment this only compiles because asm-generic/io.h defines PCI_IOBASE as 0 if it is undefined

[PATCH v5 0/3] asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE

2021-05-10 Thread Niklas Schnelle
ptr_t PCI_IOBASE make inb() and friends explicitly WARN_ONCE() and return 0xff... (Arnd Bergmann) Niklas Schnelle (3): sparc: explicitly set PCI_IOBASE to 0 risc-v: Use generic io.h helpers for nommu asm-generic/io.h: warn in inb() and friends with undefined PCI_IOBASE arch/riscv/include/asm/io.h

[PATCH v5--cover-letter 2/3] risc-v: Use generic io.h helpers for nommu

2021-05-10 Thread Niklas Schnelle
From: Niklas Schnelle Without MMU support PCI_IOBASE is left undefined because PCI_IO_END is VMEMMAP_START. Nevertheless the in*()/out*() helper macros are left defined with uses of PCI_IOBASE. At the moment this only compiles because asm-generic/io.h defines PCI_IOBASE as 0 if it is undefined

[PATCH v5--cover-letter 3/3] asm-generic/io.h: warn in inb() and friends with undefined PCI_IOBASE

2021-05-10 Thread Niklas Schnelle
ng by letting inb() and friends fail with WARN_ONCE() and a 0xff... return in case PCI_IOBASE is not defined. Link: https://lore.kernel.org/lkml/2021042759.2059976-1-schne...@linux.ibm.com/ Signed-off-by: Niklas Schnelle --- include/asm-generic/io.h | 65 +-

[PATCH v5--cover-letter 1/3] sparc: explicitly set PCI_IOBASE to 0

2021-05-10 Thread Niklas Schnelle
Instead of relying on the fallback in asm-generic/io.h which sets PCI_IOBASE 0 if it is not defined set it explicitly. Link: https://lore.kernel.org/lkml/CAK8P3a3PK9zyeP4ymELtc2ZYnymECoACiigw9Za+pvSJpCk5=g...@mail.gmail.com/ Signed-off-by: Niklas Schnelle --- arch/sparc/include/asm/io.h | 8

[PATCH 0/3] asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE

2021-05-10 Thread Niklas Schnelle
ptr_t PCI_IOBASE make inb() and friends explicitly WARN_ONCE() and return 0xff... (Arnd Bergmann) Niklas Schnelle (3): sparc: explicitly set PCI_IOBASE to 0 risc-v: Use generic io.h helpers for nommu asm-generic/io.h: warn in inb() and friends with undefined PCI_IOBASE arch/riscv/include/asm/io.h

Re: [PATCH v4 0/3] asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE

2021-05-04 Thread Niklas Schnelle
On Mon, 2021-05-03 at 18:07 +0200, Arnd Bergmann wrote: > On Fri, Apr 30, 2021 at 1:16 PM Niklas Schnelle > wrote: > > From: Niklas Schnelle > > > > This is version 4 of my attempt to get rid of a clang > > -Wnull-pointer-arithmetic warning for the use of PCI_

[PATCH v4 1/3] sparc: explicitly set PCI_IOBASE to 0

2021-04-30 Thread Niklas Schnelle
Instead of relying on the fallback in asm-generic/io.h which sets PCI_IOBASE 0 if it is not defined set it explicitly. Link: https://lore.kernel.org/lkml/CAK8P3a3PK9zyeP4ymELtc2ZYnymECoACiigw9Za+pvSJpCk5=g...@mail.gmail.com/ Signed-off-by: Niklas Schnelle --- arch/sparc/include/asm/io.h | 8

[PATCH v4 0/3] asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE

2021-04-30 Thread Niklas Schnelle
From: Niklas Schnelle Hi, This is version 4 of my attempt to get rid of a clang -Wnull-pointer-arithmetic warning for the use of PCI_IOBASE in asm-generic/io.h. This was originally found on s390 but should apply to all platforms leaving PCI_IOBASE undefined while making use of the inb() and

[PATCH v4 3/3] asm-generic/io.h: warn in inb() and friends with undefined PCI_IOBASE

2021-04-30 Thread Niklas Schnelle
ng by letting inb() and friends fail with WARN_ONCE() and a 0xff... return in case PCI_IOBASE is not defined. Signed-off-by: Niklas Schnelle --- include/asm-generic/io.h | 65 +--- 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/include/asm-generic

[PATCH v4 2/3] risc-v: Use generic io.h helpers for nommu

2021-04-30 Thread Niklas Schnelle
From: Niklas Schnelle Without MMU support PCI_IOBASE is left undefined because PCI_IO_END is VMEMMAP_START. Nevertheless the in*()/out*() helper macros are left defined with uses of PCI_IOBASE. At the moment this only compiles because asm-generic/io.h defines PCI_IOBASE as 0 if it is undefined

Re: [PATCH v3 3/3] asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE

2021-04-21 Thread Niklas Schnelle
On Wed, 2021-04-21 at 11:24 +, David Laight wrote: > From: Niklas Schnelle > > Sent: 21 April 2021 12:18 > > > > When PCI_IOBASE is not defined, it is set to 0 such that it is ignored > > in calls to the readX/writeX primitives. This triggers clang's > >

[PATCH v3 0/3] asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE

2021-04-21 Thread Niklas Schnelle
() and friends explicitly WARN_ONCE() and return 0xff... (Arnd Bergmann) Niklas Schnelle (3): sparc: explicitly set PCI_IOBASE to 0 ARC: io.h: Include asm/bug.h asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE arch/arc/include/asm/io.h | 1 + arch/sparc

[PATCH v3 1/3] sparc: explicitly set PCI_IOBASE to 0

2021-04-21 Thread Niklas Schnelle
Instead of relying on the fallback in asm-generic/io.h which sets PCI_IOBASE 0 if it is not defined set it explicitly. Link: https://lore.kernel.org/lkml/CAK8P3a3PK9zyeP4ymELtc2ZYnymECoACiigw9Za+pvSJpCk5=g...@mail.gmail.com/ Signed-off-by: Niklas Schnelle --- v1 -> v2: - Improved comment (Da

[PATCH v3 3/3] asm-generic/io.h: Silence -Wnull-pointer-arithmetic warning on PCI_IOBASE

2021-04-21 Thread Niklas Schnelle
Make things explicit and silence the warning by letting inb() and friends fail with WARN_ONCE() and a 0xff... return in case PCI_IOBASE is not defined. Signed-off-by: Niklas Schnelle --- v2 -> v3: - Added ifdefs to ioport_map() and __pci_ioport_map() since apparently at least test config

[PATCH v3 2/3] ARC: io.h: Include asm/bug.h

2021-04-21 Thread Niklas Schnelle
From: Niklas Schnelle In a future change asm-generic/io.h will make inb() and friends WARN_ONCE() on systems without I/O port support. This requires WARN_ONCE() from asm/bug.h to be included so include it in the arch specific io.h as done by other architectures. Signed-off-by: Niklas Schnelle