Thread (25 messages) flat view 25 messages, 3 authors, 2021-12-07

Re: [PATCHv5 1/4] arm64: io: Use asm-generic high level MMIO accessors

From: Sai Prakash Ranjan <hidden>
Date: 2021-12-06 11:12:14
Also in: linux-arm-msm, lkml

On 12/6/2021 2:20 PM, Arnd Bergmann wrote:
On Mon, Dec 6, 2021 at 9:28 AM Sai Prakash Ranjan
[off-list ref] wrote:
quoted
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 <redacted>
This looks correct, but I would change one detail:
quoted
+#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.
Makes sense, will do this.
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()
So __iormb on arm64 has some dummy control dependency stuff as well based on
("arm64: io: Ensure calls to delay routines are ordered against prior 
readX()") and then we would
need to change __iormb definition to __io_ar which doesn't seem like 
__iormb definition to be exact
right?

Thanks,
Sai

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help