Messages in this thread | | | From | Arnd Bergmann <> | Date | Fri, 14 Jan 2022 07:57:27 +0100 | Subject | Re: [PATCH v6 2/4] rtc: goldfish: use __raw_writel()/__raw_readl() |
| |
On Thu, Jan 13, 2022 at 9:19 PM Laurent Vivier <laurent@vivier.eu> wrote: > > As android implementation defines the endianness of the device is the one > of the architecture replace all writel()/readl() by > __raw_writel()/__raw_readl() > > https://android.googlesource.com/platform/external/qemu/+/refs/heads/emu-master-dev/hw/timer/goldfish_timer.c#177 > > The same change has been done for goldfish-tty: > > commit da31de35cd2f ("tty: goldfish: use __raw_writel()/__raw_readl()") > > Signed-off-by: Laurent Vivier <laurent@vivier.eu>
__raw_readl() isn't really the correct interface though, this is not well-defined to have a particular meaning at all, and doesn't guarantee atomicity or a particular endianess across architectures.
I'd suggest defining a set of goldfish specific accessors per architecture that turn into either readl() or swabl(readl()), to allow future architectures to define this properly in qemu.
Arnd
| |