Re: [PATCH v10 2/5] rtc: goldfish: introduce goldfish_ioread32()/goldfish_iowrite32()
From: Laurent Vivier
Date: Wed Jan 19 2022 - 04:11:55 EST
Le 19/01/2022 à 09:49, Arnd Bergmann a écrit :
On Wed, Jan 19, 2022 at 9:21 AM Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
On Wed, Jan 19, 2022 at 1:05 AM Laurent Vivier <laurent@xxxxxxxxx> wrote:
I've just discovered include/linux/goldfish.h, which already has gf_*()
accessors for 64-bit, so it'd make sense to move the above there,
and adjust the names.
Yes, good idea.
So the idea is to put goldfish accessors inside a "#ifdef CONFIG_M68K ... #else ... #endif" in
include/linux/goldfish.h and not in generic-asm/io.h for the generic version and
m68k/include/ams/io.h for the m68k version?
Arnd: note that the existing ones do use __raw_writel().
It looks like Laurent introduced that bug in da31de35cd2f ("tty: goldfish: use
__raw_writel()/__raw_readl()") and could fix it up here. Laurent, was the intent
The idea was to use the native endianness of the CPU, I missed it can differ from the one of the
architecture.
of this earlier patch also to make the driver usabel for m68k, or are there
any other targets you looked at that had mixed up endianness?
Yes, the intent was to make it usable for m68k.
I think all the targets that use goldfish are little-endian, it's why there was no problem until now.
Let me know which solution you prefer, I will update the series accordingly.
Thanks,
Laurent