From: Julian Vetter <julian@outer-limits.org>
To: Arnd Bergmann <arnd@arndb.de>,
Richard Henderson <richard.henderson@linaro.org>,
Matt Turner <mattst88@gmail.com>,
"Paul E . McKenney" <paulmck@kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org,
Julian Vetter <julian@outer-limits.org>
Subject: [PATCH v2 2/2] alpha: Remove IO memcpy and memset
Date: Mon, 3 Feb 2025 16:42:16 +0100 [thread overview]
Message-ID: <20250203154216.172040-2-julian@outer-limits.org> (raw)
In-Reply-To: <20250203154216.172040-1-julian@outer-limits.org>
Recently new IO memcpy were added in libs/iomem_copy.c. So, remove the
alpha specific implementations and use the ones from the lib code.
Signed-off-by: Julian Vetter <julian@outer-limits.org>
---
Changes for V2:
- Split the patch into two:
- One that shuffles the memsetw_io and _memset_c_io around
- And one that removed the memcpy_fromio and memcpy_toio
---
arch/alpha/include/asm/io.h | 5 --
arch/alpha/kernel/io.c | 109 ------------------------------------
2 files changed, 114 deletions(-)
diff --git a/arch/alpha/include/asm/io.h b/arch/alpha/include/asm/io.h
index d6e868872e19..ba45f84c97f1 100644
--- a/arch/alpha/include/asm/io.h
+++ b/arch/alpha/include/asm/io.h
@@ -590,13 +590,8 @@ extern inline u64 readq_relaxed(const volatile void __iomem *addr)
/*
* String version of IO memory access ops:
*/
-extern void memcpy_fromio(void *, const volatile void __iomem *, long);
-extern void memcpy_toio(volatile void __iomem *, const void *, long);
extern void memsetw_io(volatile void __iomem *to, u16 c, long count);
-#define memcpy_fromio memcpy_fromio
-#define memcpy_toio memcpy_toio
-
/*
* String versions of in/out ops:
*/
diff --git a/arch/alpha/kernel/io.c b/arch/alpha/kernel/io.c
index 353b1dcbd422..a6a53fcfafb6 100644
--- a/arch/alpha/kernel/io.c
+++ b/arch/alpha/kernel/io.c
@@ -476,115 +476,6 @@ void outsl(unsigned long port, const void *src, unsigned long count)
EXPORT_SYMBOL(iowrite32_rep);
EXPORT_SYMBOL(outsl);
-
-/*
- * Copy data from IO memory space to "real" memory space.
- * This needs to be optimized.
- */
-void memcpy_fromio(void *to, const volatile void __iomem *from, long count)
-{
- /* Optimize co-aligned transfers. Everything else gets handled
- a byte at a time. */
-
- if (count >= 8 && ((u64)to & 7) == ((u64)from & 7)) {
- count -= 8;
- do {
- *(u64 *)to = __raw_readq(from);
- count -= 8;
- to += 8;
- from += 8;
- } while (count >= 0);
- count += 8;
- }
-
- if (count >= 4 && ((u64)to & 3) == ((u64)from & 3)) {
- count -= 4;
- do {
- *(u32 *)to = __raw_readl(from);
- count -= 4;
- to += 4;
- from += 4;
- } while (count >= 0);
- count += 4;
- }
-
- if (count >= 2 && ((u64)to & 1) == ((u64)from & 1)) {
- count -= 2;
- do {
- *(u16 *)to = __raw_readw(from);
- count -= 2;
- to += 2;
- from += 2;
- } while (count >= 0);
- count += 2;
- }
-
- while (count > 0) {
- *(u8 *) to = __raw_readb(from);
- count--;
- to++;
- from++;
- }
- mb();
-}
-
-EXPORT_SYMBOL(memcpy_fromio);
-
-
-/*
- * Copy data from "real" memory space to IO memory space.
- * This needs to be optimized.
- */
-void memcpy_toio(volatile void __iomem *to, const void *from, long count)
-{
- /* Optimize co-aligned transfers. Everything else gets handled
- a byte at a time. */
- /* FIXME -- align FROM. */
-
- if (count >= 8 && ((u64)to & 7) == ((u64)from & 7)) {
- count -= 8;
- do {
- __raw_writeq(*(const u64 *)from, to);
- count -= 8;
- to += 8;
- from += 8;
- } while (count >= 0);
- count += 8;
- }
-
- if (count >= 4 && ((u64)to & 3) == ((u64)from & 3)) {
- count -= 4;
- do {
- __raw_writel(*(const u32 *)from, to);
- count -= 4;
- to += 4;
- from += 4;
- } while (count >= 0);
- count += 4;
- }
-
- if (count >= 2 && ((u64)to & 1) == ((u64)from & 1)) {
- count -= 2;
- do {
- __raw_writew(*(const u16 *)from, to);
- count -= 2;
- to += 2;
- from += 2;
- } while (count >= 0);
- count += 2;
- }
-
- while (count > 0) {
- __raw_writeb(*(const u8 *) from, to);
- count--;
- to++;
- from++;
- }
- mb();
-}
-
-EXPORT_SYMBOL(memcpy_toio);
-
#if IS_ENABLED(CONFIG_VGA_CONSOLE) || IS_ENABLED(CONFIG_MDA_CONSOLE)
#include <asm/vga.h>
--
2.34.1
next prev parent reply other threads:[~2025-02-03 15:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-03 15:42 [PATCH v2 1/2] alpha: rework use of memset_io, memsetw_io and scr_memsetw Julian Vetter
2025-02-03 15:42 ` Julian Vetter [this message]
2025-02-03 17:24 ` [PATCH v2 2/2] alpha: Remove IO memcpy and memset Arnd Bergmann
2025-02-04 21:10 ` Maciej W. Rozycki
2025-02-03 17:24 ` [PATCH v2 1/2] alpha: rework use of memset_io, memsetw_io and scr_memsetw Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250203154216.172040-2-julian@outer-limits.org \
--to=julian@outer-limits.org \
--cc=arnd@arndb.de \
--cc=linus.walleij@linaro.org \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mattst88@gmail.com \
--cc=paulmck@kernel.org \
--cc=richard.henderson@linaro.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox