[PATCH v1] asm-generic: Describe the logic beind the __io barrier names
From: Palmer Dabbelt
Date: Thu Apr 14 2022 - 18:46:03 EST
From: Palmer Dabbelt <palmer@xxxxxxxxxxxx>
These names are very terse, as they weren't originally designed to be
this spread out. There was recently some confusion as to how this fits
together, hopefully this comment makes them easier to understand.
Signed-off-by: Palmer Dabbelt <palmer@xxxxxxxxxxxx>
---
Maybe we should use 'm', instead of '', for the MMIO barriers?
---
include/asm-generic/io.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 7ce93aaf69f8..1297807b5831 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -18,6 +18,15 @@
#include <asm/mmiowb.h>
#include <asm-generic/pci_iomap.h>
+/*
+ * These generic IO helpers provide a handful of architecture hooks, which are
+ * the Cartesian product over three dimensions:
+ * - Memory (the empty character) and port ('p'). The memory flavor is used
+ * for MMIO (read/write), the ports are used for port IO (in/out).
+ * - Before ('b') and after ('a'), which are inserted before/after the raw
+ * access.
+ * - Read ('r') and write ('w'), for the direction of the access.
+ */
#ifndef __io_br
#define __io_br() barrier()
#endif
--
2.34.1