[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <4436aef8-3947-4923-96ee-47516e63e5bb@app.fastmail.com>
Date: Tue, 23 Jul 2024 08:50:21 +0000
From: "Arnd Bergmann" <arnd@...db.de>
To: "Yann Sionneau" <ysionneau@...rayinc.com>, linux-kernel@...r.kernel.org
Cc: "Jonathan Borne" <jborne@...rayinc.com>,
 "Julian Vetter" <jvetter@...rayinc.com>,
 "Clement Leger" <clement@...ment-leger.fr>,
 "Guillaume Thouvenin" <thouveng@...il.com>,
 "Julien Villette" <julien.villette@...il.com>
Subject: Re: [RFC PATCH v3 28/37] kvx: Add misc common routines
On Mon, Jul 22, 2024, at 09:41, ysionneau@...rayinc.com wrote:
> +/*
> + * Copy data from IO memory space to "real" memory space.
> + */
> +void __memcpy_fromio(void *to, const volatile void __iomem *from, size_t count)
> +{
> +	while (count && !IS_ALIGNED((unsigned long)from, 8)) {
> +		*(u8 *)to = __raw_readb(from);
> +		from++;
> +		to++;
> +		count--;
> +	}
> +
> +	while (count >= 8) {
> +		*(u64 *)to = __raw_readq(from);
> +		from += 8;
> +		to += 8;
> +		count -= 8;
> +	}
I see this entire file is largely identical to the corresponding
one from arm64, loongarch and (mostly) csky. Can you instead
combine the existing ones into a copy in lib/ and use that?
This would be a good thing to send before the rest of your series.
      Arnd
Powered by blists - more mailing lists
 
