[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.2502042056540.41663@angie.orcam.me.uk>
Date: Tue, 4 Feb 2025 21:07:56 +0000 (GMT)
From: "Maciej W. Rozycki" <macro@...am.me.uk>
To: Julian Vetter <julian@...er-limits.org>
cc: Arnd Bergmann <arnd@...db.de>,
Richard Henderson <richard.henderson@...aro.org>,
Matt Turner <mattst88@...il.com>, "Paul E . McKenney" <paulmck@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Al Viro <viro@...iv.linux.org.uk>, linux-alpha@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] alpha: Remove IO memcpy and memset
On Mon, 3 Feb 2025, Julian Vetter wrote:
> Recently a new IO memcpy and memset was added in libs/iomem_copy.c. So,
^
This has to be lib/iomem_copy.c.
> remove the alpha specific implementations and use the one from the lib.
You're dropping the memory barriers, which the generic code doesn't have,
so should we agree to switch to the generic version it has to be confirmed
what the right course of action is:
1. Use wrapper calls with memory barriers.
2. Add memory barriers to generic code.
3. Conclude that dropping is correct and adjust the callers where
applicable.
4. Something else maybe.
See below for the actual places.
> diff --git a/arch/alpha/kernel/io.c b/arch/alpha/kernel/io.c
> index c28035d6d1e6..0d24a6ad682c 100644
> --- a/arch/alpha/kernel/io.c
> +++ b/arch/alpha/kernel/io.c
> @@ -476,177 +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)
> -{
[...]
> - while (count > 0) {
> - *(u8 *) to = __raw_readb(from);
> - count--;
> - to++;
> - from++;
> - }
> - mb();
Here...
> -void memcpy_toio(volatile void __iomem *to, const void *from, long count)
> -{
[...]
> - while (count > 0) {
> - __raw_writeb(*(const u8 *) from, to);
> - count--;
> - to++;
> - from++;
> - }
> - mb();
... here...
> -void _memset_c_io(volatile void __iomem *to, unsigned long c, long count)
> -{
[...]
> - /* And finally, one last byte.. */
> - if (count) {
> - __raw_writeb(c, to);
> - }
> - mb();
... and here.
Maciej
Powered by blists - more mailing lists