arch/*/io.h: remove ioremap_uc in some architectures
authorBaoquan He <bhe@redhat.com>
Thu, 21 Sep 2023 11:04:23 +0000 (19:04 +0800)
committerArnd Bergmann <arnd@arndb.de>
Thu, 23 Nov 2023 09:32:52 +0000 (10:32 +0100)
ioremap_uc() is only meaningful on old x86-32 systems with the PAT
extension, and on ia64 with its slightly unconventional ioremap()
behavior. So remove the ioremap_uc() definition in architecutures
other than x86 and ia64. These architectures all have asm-generic/io.h
included and will have the default ioremap_uc() definition which
returns NULL.

This changes the existing behaviour, while no need to worry about
any breakage because in the only callsite of ioremap_uc(), code
has been adjusted to eliminate the impact. Please see
atyfb_setup_generic() of drivers/video/fbdev/aty/atyfb_base.c.

If any new invocation of ioremap_uc() need be added, please consider
using ioremap() intead or adding a ARCH specific version if necessary.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Acked-by: Helge Deller <deller@gmx.de> # parisc
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> (SuperH)
Cc: linux-alpha@vger.kernel.org
Cc: linux-hexagon@vger.kernel.org
Cc: linux-m68k@lists.linux-m68k.org
Cc: linux-mips@vger.kernel.org
Cc: linux-parisc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-sh@vger.kernel.org
Cc: sparclinux@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Documentation/driver-api/device-io.rst
arch/alpha/include/asm/io.h
arch/hexagon/include/asm/io.h
arch/m68k/include/asm/kmap.h
arch/mips/include/asm/io.h
arch/parisc/include/asm/io.h
arch/powerpc/include/asm/io.h
arch/sh/include/asm/io.h
arch/sparc/include/asm/io_64.h

index 2c7abd234f4e2480de17eec155191ddeb6b69fbe..d55384b106bd4ef7e4c41b77ea58624dbda88688 100644 (file)
@@ -408,11 +408,12 @@ functions for details on the CPU side of things.
 ioremap_uc()
 ------------
 
-ioremap_uc() behaves like ioremap() except that on the x86 architecture without
-'PAT' mode, it marks memory as uncached even when the MTRR has designated
-it as cacheable, see Documentation/arch/x86/pat.rst.
+ioremap_uc() is only meaningful on old x86-32 systems with the PAT extension,
+and on ia64 with its slightly unconventional ioremap() behavior, everywhere
+elss ioremap_uc() defaults to return NULL.
 
-Portable drivers should avoid the use of ioremap_uc().
+
+Portable drivers should avoid the use of ioremap_uc(), use ioremap() instead.
 
 ioremap_cache()
 ---------------
index 7aeaf7c30a6f6404935929dc83763b9fbadaf50e..076f0e4e7f1e18ef2ebd4e48275352fed36e296a 100644 (file)
@@ -308,7 +308,6 @@ static inline void __iomem *ioremap(unsigned long port, unsigned long size)
 }
 
 #define ioremap_wc ioremap
-#define ioremap_uc ioremap
 
 static inline void iounmap(volatile void __iomem *addr)
 {
index e2b308e32a379d2057636c2b2d8ac8731d0487dc..b7bc246dbcb19dd30d29d9922f95504c6488454d 100644 (file)
@@ -174,9 +174,6 @@ static inline void writel(u32 data, volatile void __iomem *addr)
 #define _PAGE_IOREMAP (_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \
                       (__HEXAGON_C_DEV << 6))
 
-#define ioremap_uc(addr, size) ioremap((addr), (size))
-
-
 #define __raw_writel writel
 
 static inline void memcpy_fromio(void *dst, const volatile void __iomem *src,
index 4efb3efa593a4f3b08ae7bc59f7badeccbce7a5e..b778f015c917f934d9aa36071414c27ad539d323 100644 (file)
@@ -25,7 +25,6 @@ static inline void __iomem *ioremap(unsigned long physaddr, unsigned long size)
        return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
 }
 
-#define ioremap_uc ioremap
 #define ioremap_wt ioremap_wt
 static inline void __iomem *ioremap_wt(unsigned long physaddr,
                                       unsigned long size)
index 41d8bd5adef84b96eb5e21af77173f28375db943..1ecf255efb4046e3e305607ce039ddc275fd9adb 100644 (file)
@@ -170,7 +170,6 @@ void iounmap(const volatile void __iomem *addr);
  */
 #define ioremap(offset, size)                                          \
        ioremap_prot((offset), (size), _CACHE_UNCACHED)
-#define ioremap_uc             ioremap
 
 /*
  * ioremap_cache -     map bus memory into CPU space
index 366537042465a16a184d8e6a298dfba46051506d..48630c78714a7b2e8f1b8b8fe555c0e51efeb045 100644 (file)
@@ -132,8 +132,6 @@ static inline void gsc_writeq(unsigned long long val, unsigned long addr)
 
 #define ioremap_wc(addr, size)  \
        ioremap_prot((addr), (size), _PAGE_IOREMAP)
-#define ioremap_uc(addr, size)  \
-       ioremap_prot((addr), (size), _PAGE_IOREMAP)
 
 #define pci_iounmap                    pci_iounmap
 
index 5220274a62772ade81b281c9ffc9c06cf138f34a..bc624a84531d7b305ed2ecda291adfeda3f7d0d6 100644 (file)
@@ -900,7 +900,6 @@ void __iomem *ioremap_wt(phys_addr_t address, unsigned long size);
 #endif
 
 void __iomem *ioremap_coherent(phys_addr_t address, unsigned long size);
-#define ioremap_uc(addr, size)         ioremap((addr), (size))
 #define ioremap_cache(addr, size) \
        ioremap_prot((addr), (size), pgprot_val(PAGE_KERNEL))
 
index ac521f287fa5967b2463d8c4bd5c7b4d09c2b686..d0b4e07656545f6a29d32b504ddfbd926837f8b1 100644 (file)
@@ -302,8 +302,6 @@ unsigned long long poke_real_address_q(unsigned long long addr,
        ioremap_prot((addr), (size), pgprot_val(PAGE_KERNEL))
 #endif /* CONFIG_MMU */
 
-#define ioremap_uc     ioremap
-
 /*
  * Convert a physical pointer to a virtual kernel pointer for /dev/mem
  * access
index 9303270b22f3cfd4df85d3abfddebe7824725c75..d8ee1442f30348133c20d3396da0fba8492b34b5 100644 (file)
@@ -423,7 +423,6 @@ static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
        return (void __iomem *)offset;
 }
 
-#define ioremap_uc(X,Y)                        ioremap((X),(Y))
 #define ioremap_wc(X,Y)                        ioremap((X),(Y))
 #define ioremap_wt(X,Y)                        ioremap((X),(Y))
 static inline void __iomem *ioremap_np(unsigned long offset, unsigned long size)