lkml.org 
[lkml]   [2021]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCHv5 1/4] arm64: io: Use asm-generic high level MMIO accessors
On Mon, Dec 6, 2021 at 9:28 AM Sai Prakash Ranjan
<quic_saipraka@quicinc.com> wrote:
>
> Remove custom arm64 MMIO accessors read{b,w,l,q} and their relaxed
> versions in support to use asm-generic ones. Also define arm64
> barrier macros to override the asm-generic defined barriers.
>
> Suggested-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Sai Prakash Ranjan <quic_saipraka@quicinc.com>

This looks correct, but I would change one detail:

> +#define __io_ar(v) __io_par(v)
> +#define __io_bw() __iowmb()
> +#define __io_br(v)
> +#define __io_aw(v)

The default __io_par() is defined in terms of __io_ar(), so it would
be more logical
to remove the custom __io_par() and just define __io_ar() here.

I think it would be even better to flip these around and make the low-level
definitions __io_ar() and __io_bw(), and then defining the arm64 specific
macros based on those:

/* arm64-specific, don't use in portable drivers */
#define __iormb(v) __io_ar(v)
#define __iowmb() __io_bw()
#define __iomb() dma_mb()

Arnd

\
 
 \ /
  Last update: 2021-12-06 09:51    [W:1.530 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site