lkml.org 
[lkml]   [2022]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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

\
 
 \ /
  Last update: 2022-01-14 07:59    [W:0.215 / U:0.960 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site