]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
parisc: Remove memcpy_fromio
authorJulian Vetter <julian@outer-limits.org>
Thu, 30 Jan 2025 13:48:25 +0000 (14:48 +0100)
committerHelge Deller <deller@gmx.de>
Mon, 3 Feb 2025 18:27:00 +0000 (19:27 +0100)
Fully migrate parisc to the IO functions from lib/iomem_copy.c. In a
recent patch the functions memset_io and memcpy_toio were removed, but
the memcpy_fromio was kept, because for very short sequences it does
half word accesses, whereas the functions in lib/iomem_copy.c do byte
accesses until the memory is naturally aligned and then do machine word
accesses. But I don't think the single half-word access merits keeping
the arch specific implementation, so, remove it as well.

Signed-off-by: Julian Vetter <julian@outer-limits.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/include/asm/io.h
arch/parisc/kernel/parisc_ksyms.c
arch/parisc/lib/io.c

index 3143cf29ce27b47894af0ef79e305a203ee160c9..61173a2b38e414ae306f9377aa64e8cbd3fe259e 100644 (file)
@@ -135,9 +135,6 @@ static inline void gsc_writeq(unsigned long long val, unsigned long addr)
 
 #define pci_iounmap                    pci_iounmap
 
-void memcpy_fromio(void *dst, const volatile void __iomem *src, int count);
-#define memcpy_fromio memcpy_fromio
-
 /* Port-space IO */
 
 #define inb_p inb
index 1c366b0d3134b8297d2ce90e66eb4a76966f39a2..509146a52725c29954145adc781116be1e4317f9 100644 (file)
@@ -43,7 +43,6 @@ EXPORT_SYMBOL($global$);
 #endif
 
 #include <asm/io.h>
-EXPORT_SYMBOL(memcpy_fromio);
 
 extern void $$divI(void);
 extern void $$divU(void);
index 6e81200dc87af9b4d1426d09b40b3647d52f0746..3c7e617f5a939b1d56379637939ef4b5be121c25 100644 (file)
 #include <linux/module.h>
 #include <asm/io.h>
 
-/*
-** Copies a block of memory from a device in an efficient manner.
-** Assumes the device can cope with 32-bit transfers.  If it can't,
-** don't use this function.
-**
-** CR16 counts on C3000 reading 256 bytes from Symbios 896 RAM:
-**     27341/64    = 427 cyc per int
-**     61311/128   = 478 cyc per short
-**     122637/256  = 479 cyc per byte
-** Ergo bus latencies dominant (not transfer size).
-**      Minimize total number of transfers at cost of CPU cycles.
-**     TODO: only look at src alignment and adjust the stores to dest.
-*/
-void memcpy_fromio(void *dst, const volatile void __iomem *src, int count)
-{
-       /* first compare alignment of src/dst */ 
-       if ( (((unsigned long)dst ^ (unsigned long)src) & 1) || (count < 2) )
-               goto bytecopy;
-
-       if ( (((unsigned long)dst ^ (unsigned long)src) & 2) || (count < 4) )
-               goto shortcopy;
-
-       /* Then check for misaligned start address */
-       if ((unsigned long)src & 1) {
-               *(u8 *)dst = readb(src);
-               src++;
-               dst++;
-               count--;
-               if (count < 2) goto bytecopy;
-       }
-
-       if ((unsigned long)src & 2) {
-               *(u16 *)dst = __raw_readw(src);
-               src += 2;
-               dst += 2;
-               count -= 2;
-       }
-
-       while (count > 3) {
-               *(u32 *)dst = __raw_readl(src);
-               dst += 4;
-               src += 4;
-               count -= 4;
-       }
-
- shortcopy:
-       while (count > 1) {
-               *(u16 *)dst = __raw_readw(src);
-               src += 2;
-               dst += 2;
-               count -= 2;
-       }
-
- bytecopy:
-       while (count--) {
-               *(char *)dst = readb(src);
-               src++;
-               dst++;
-       }
-}
-
 /*
  * Read COUNT 8-bit bytes from port PORT into memory starting at
  * SRC.