sh: fix asm-generic/io.h inclusion
PATCH 1/1 sh: fix asm-generic/io.h inclusion
From: Arnd Bergmann <[email protected]>
A recent cleanup patch started using the generic asm/io.h header from the sh version, but unfortunately this caused build regressions in many configurations, such as:
include/asm-generic/io.h:636:15: error: redefinition of ‘inb_p’
I added some of the missing defines that are needed to keep using the sh specific implementations rather than the generic ones where they clash. I build all sh defconfig files to catch the various combinations of CONFIG_MMU, CONFIG_GENERIC_IOMAP and CONFIG_NO_IOPORT_MAP, this should cover them all.
A lot of the sh specific functions are equivalent to the generic ones and could in fact be removed, but it would be best to only do that with actual runtime testing.
In particular, the indirect ioport_map() implementation is only used for the "microdev" platform that appears to be broken beyond repair for as long as the git history goes, so removing both microdev and the custom ioport handling in favor of the asm-generic/io.h version would be a great cleanup, but this can be done another time if anyone feels motivated to clean up arch/sh.
---
Andrew, can you pick this up into the mm tree on top of the "sh: add <asm-generic/io.h> including" patch?
--- arch/sh/include/asm/io.h | 24 ++++++++++++++++++++++++ arch/sh/include/asm/io_noioport.h | 14 -------------- 2 files changed, 24 insertions(+), 14 deletions(-)
arch/sh/include/asm/io.h +24 -0
@@ -119,6 +119,10 @@ void __raw_readsl(const void __iomem *addr, void *data, int longlen); __BUILD_MEMORY_STRING(__raw_, q, u64) +#define ioport_map ioport_map +#define ioport_unmap ioport_unmap +#define pci_iounmap pci_iounmap +#define ioread8 ioread8#define ioread16 ioread16#define ioread16be ioread16be
@@ -241,6 +245,26 @@ __BUILD_IOPORT_STRING(q, u64)#endif +#define inb (addr) inb(addr) +#define inw (addr) inw(addr) +#define inl (addr) inl(addr) +#define outb (x, addr) outb((x), (addr)) +#define outw (x, addr) outw((x), (addr)) +#define outl (x, addr) outl((x), (addr)) + +#define inb_p (addr) inb(addr) +#define inw_p (addr) inw(addr) +#define inl_p (addr) inl(addr) +#define outb_p (x, addr) outb((x), (addr)) +#define outw_p (x, addr) outw((x), (addr)) +#define outl_p (x, addr) outl((x), (addr)) + +#define insb insb +#define insw insw +#define insl insl +#define outsb outsb +#define outsw outsw +#define outsl outsl#define IO_SPACE_LIMIT 0xffffffff
arch/sh/include/asm/io_noioport.h +0 -14
@@ -46,20 +46,6 @@ static inline void ioport_unmap(void __iomem *addr)BUG (); } -#define inb_p (addr) inb(addr) -#define inw_p (addr) inw(addr) -#define inl_p (addr) inl(addr) -#define outb_p (x, addr) outb((x), (addr)) -#define outw_p (x, addr) outw((x), (addr)) -#define outl_p (x, addr) outl((x), (addr)) - -#define insb insb -#define insw insw -#define insl insl -#define outsb outsb -#define outsw outsw -#define outsl outsl -static inline void insb (unsigned long port,void *dst,unsigned long count) {BUG ();
Signature · 1 line
2.39.2
Quoted 25 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
A recent cleanup patch started using the generic
asm/io.hheader from the sh version, but unfortunately this caused build regressions in many configurations, such as:
include/asm-generic/io.h:636:15: error: redefinition of ‘inb_p’I added some of the missing defines that are needed to keep using the sh specific implementations rather than the generic ones where they clash. I build all sh defconfig files to catch the various combinations of
CONFIG_MMU,CONFIG_GENERIC_IOMAPandCONFIG_NO_IOPORT_MAP, this should cover them all.A lot of the sh specific functions are equivalent to the generic ones and could in fact be removed, but it would be best to only do that with actual runtime testing.
In particular, the indirect
ioport_map()implementation is only used for the "microdev" platform that appears to be broken beyond repair for as long as the git history goes, so removing both microdev and the custom ioport handling in favor of theasm-generic/io.hversion would be a great cleanup, but this can be done another time if anyone feels motivated to clean uparch/sh.
Quoted 4 lines
Fixes e41f1f7ff6c2b ("sh: add <asm-generic/io.h> including")Reported-by Geert Uytterhoeven <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>
Quoted 75 lines
---
Andrew, can you pick this up into the mm tree on top of the "sh: add <asm-generic/io.h> including" patch?--- arch/sh/include/asm/io.h | 24 ++++++++++++++++++++++++ arch/sh/include/asm/io_noioport.h | 14 -------------- 2 files changed, 24 insertions(+), 14 deletions(-)arch/sh/include/asm/io.h +24
-0@@ -119,6 +119,10 @@ void __raw_readsl(const void __iomem *addr, void *data, int longlen); __BUILD_MEMORY_STRING(__raw_, q, u64) +#define ioport_map ioport_map +#define ioport_unmap ioport_unmap +#define pci_iounmap pci_iounmap +#define ioread8 ioread8#define ioread16 ioread16#define ioread16be ioread16be@@ -241,6 +245,26 @@ __BUILD_IOPORT_STRING(q, u64)#endif +#define inb (addr) inb(addr) +#define inw (addr) inw(addr) +#define inl (addr) inl(addr) +#define outb (x, addr) outb((x), (addr)) +#define outw (x, addr) outw((x), (addr)) +#define outl (x, addr) outl((x), (addr)) + +#define inb_p (addr) inb(addr) +#define inw_p (addr) inw(addr) +#define inl_p (addr) inl(addr) +#define outb_p (x, addr) outb((x), (addr)) +#define outw_p (x, addr) outw((x), (addr)) +#define outl_p (x, addr) outl((x), (addr)) + +#define insb insb +#define insw insw +#define insl insl +#define outsb outsb +#define outsw outsw +#define outsl outsl#define IO_SPACE_LIMIT 0xffffffffarch/sh/include/asm/io_noioport.h +0
-14@@ -46,20 +46,6 @@ static inline void ioport_unmap(void __iomem *addr)BUG (); } -#define inb_p (addr) inb(addr) -#define inw_p (addr) inw(addr) -#define inl_p (addr) inl(addr) -#define outb_p (x, addr) outb((x), (addr)) -#define outw_p (x, addr) outw((x), (addr)) -#define outl_p (x, addr) outl((x), (addr)) - -#define insb insb -#define insw insw -#define insl insl -#define outsb outsb -#define outsw outsw -#define outsl outsl -static inline void insb (unsigned long port,void *dst,unsigned long count) {BUG ();
Hi Arnd!
Quoted 18 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
A recent cleanup patch started using the generic
asm/io.hheader from the sh version, but unfortunately this caused build regressions in many configurations, such as:
include/asm-generic/io.h:636:15: error: redefinition of ‘inb_p’I added some of the missing defines that are needed to keep using the sh specific implementations rather than the generic ones where they clash. I build all sh defconfig files to catch the various combinations of
CONFIG_MMU,CONFIG_GENERIC_IOMAPandCONFIG_NO_IOPORT_MAP, this should cover them all.A lot of the sh specific functions are equivalent to the generic ones and could in fact be removed, but it would be best to only do that with actual runtime testing.
Quoted 6 lines
In particular, the indirect
ioport_map()implementation is only used for the "microdev" platform that appears to be broken beyond repair for as long as the git history goes, so removing both microdev and the custom ioport handling in favor of theasm-generic/io.hversion would be a great cleanup, but this can be done another time if anyone feels motivated to clean uparch/sh.
Clean-up will happen with the device tree conversion.
Quoted 69 lines
Fixes e41f1f7ff6c2b ("sh: add <asm-generic/io.h> including")Reported-by Geert Uytterhoeven <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>---
Andrew, can you pick this up into the mm tree on top of the "sh: add <asm-generic/io.h> including" patch?--- arch/sh/include/asm/io.h | 24 ++++++++++++++++++++++++ arch/sh/include/asm/io_noioport.h | 14 -------------- 2 files changed, 24 insertions(+), 14 deletions(-)arch/sh/include/asm/io.h +24
-0@@ -119,6 +119,10 @@ void __raw_readsl(const void __iomem *addr, void *data, int longlen); __BUILD_MEMORY_STRING(__raw_, q, u64) +#define ioport_map ioport_map +#define ioport_unmap ioport_unmap +#define pci_iounmap pci_iounmap +#define ioread8 ioread8#define ioread16 ioread16#define ioread16be ioread16be@@ -241,6 +245,26 @@ __BUILD_IOPORT_STRING(q, u64)#endif +#define inb (addr) inb(addr) +#define inw (addr) inw(addr) +#define inl (addr) inl(addr) +#define outb (x, addr) outb((x), (addr)) +#define outw (x, addr) outw((x), (addr)) +#define outl (x, addr) outl((x), (addr)) + +#define inb_p (addr) inb(addr) +#define inw_p (addr) inw(addr) +#define inl_p (addr) inl(addr) +#define outb_p (x, addr) outb((x), (addr)) +#define outw_p (x, addr) outw((x), (addr)) +#define outl_p (x, addr) outl((x), (addr)) + +#define insb insb +#define insw insw +#define insl insl +#define outsb outsb +#define outsw outsw +#define outsl outsl#define IO_SPACE_LIMIT 0xffffffffarch/sh/include/asm/io_noioport.h +0
-7@@ -46,20 +46,6 @@ static inline void ioport_unmap(void __iomem *addr)BUG (); } -#define inb_p (addr) inb(addr) -#define inw_p (addr) inw(addr) -#define inl_p (addr) inl(addr) -#define outb_p (x, addr) outb((x), (addr)) -#define outw_p (x, addr) outw((x), (addr)) -#define outl_p (x, addr) outl((x), (addr)) -
arch/sh/include/asm/io_noioport.h static inline void ioport_unmap(void __iomem *addr) · line 51
Quoted 10 lines
arch/sh/include/asm/io_noioport.h +0
-7-#define insb insb -#define insw insw -#define insl insl -#define outsb outsb -#define outsw outsw -#define outsl outsl -static inline void insb (unsigned long port,void *dst,unsigned long count) {BUG ();
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Quoted 90 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
A recent cleanup patch started using the generic
asm/io.hheader from the sh version, but unfortunately this caused build regressions in many configurations, such as:
include/asm-generic/io.h:636:15: error: redefinition of ‘inb_p’I added some of the missing defines that are needed to keep using the sh specific implementations rather than the generic ones where they clash. I build all sh defconfig files to catch the various combinations of
CONFIG_MMU,CONFIG_GENERIC_IOMAPandCONFIG_NO_IOPORT_MAP, this should cover them all.A lot of the sh specific functions are equivalent to the generic ones and could in fact be removed, but it would be best to only do that with actual runtime testing.
In particular, the indirect
ioport_map()implementation is only used for the "microdev" platform that appears to be broken beyond repair for as long as the git history goes, so removing both microdev and the custom ioport handling in favor of theasm-generic/io.hversion would be a great cleanup, but this can be done another time if anyone feels motivated to clean uparch/sh.Fixes e41f1f7ff6c2b ("sh: add <asm-generic/io.h> including")Reported-by Geert Uytterhoeven <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>---
Andrew, can you pick this up into the mm tree on top of the "sh: add <asm-generic/io.h> including" patch?--- arch/sh/include/asm/io.h | 24 ++++++++++++++++++++++++ arch/sh/include/asm/io_noioport.h | 14 -------------- 2 files changed, 24 insertions(+), 14 deletions(-)arch/sh/include/asm/io.h +24
-0@@ -119,6 +119,10 @@ void __raw_readsl(const void __iomem *addr, void *data, int longlen); __BUILD_MEMORY_STRING(__raw_, q, u64) +#define ioport_map ioport_map +#define ioport_unmap ioport_unmap +#define pci_iounmap pci_iounmap +#define ioread8 ioread8#define ioread16 ioread16#define ioread16be ioread16be@@ -241,6 +245,26 @@ __BUILD_IOPORT_STRING(q, u64)#endif +#define inb (addr) inb(addr) +#define inw (addr) inw(addr) +#define inl (addr) inl(addr) +#define outb (x, addr) outb((x), (addr)) +#define outw (x, addr) outw((x), (addr)) +#define outl (x, addr) outl((x), (addr)) + +#define inb_p (addr) inb(addr) +#define inw_p (addr) inw(addr) +#define inl_p (addr) inl(addr) +#define outb_p (x, addr) outb((x), (addr)) +#define outw_p (x, addr) outw((x), (addr)) +#define outl_p (x, addr) outl((x), (addr)) + +#define insb insb +#define insw insw +#define insl insl +#define outsb outsb +#define outsw outsw +#define outsl outsl#define IO_SPACE_LIMIT 0xffffffffarch/sh/include/asm/io_noioport.h +0
-3@@ -46,20 +46,6 @@ static inline void ioport_unmap(void __iomem *addr)BUG (); } -#define inb_p (addr) inb(addr) -#define inw_p (addr) inw(addr) -#define inl_p (addr) inl(addr)
arch/sh/include/asm/io_noioport.h static inline void ioport_unmap(void __iomem *addr) · line 61
Quoted 10 lines
arch/sh/include/asm/io_noioport.h +0
-10-#define outb_p (x, addr) outb((x), (addr)) -#define outw_p (x, addr) outw((x), (addr)) -#define outl_p (x, addr) outl((x), (addr)) - -#define insb insb -#define insw insw -#define insl insl -#define outsb outsb -#define outsw outsw -#define outsl outsl
Thanks for this fixing.