[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220904195920.1763240-1-oliver@schinagl.nl>
Date: Sun, 4 Sep 2022 21:59:20 +0200
From: Olliver Schinagl <oliver@...inagl.nl>
To: linux-kernel@...r.kernel.org
Cc: Olliver Schinagl <oliver+list@...inagl.nl>,
Matt Wagantall <mattw@...eaurora.org>,
Thierry Reding <thierry.reding@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Robert Elliott <elliott@...com>, Arnd Bergmann <arnd@...db.de>,
Will Deacon <will.deacon@....com>,
Olliver Schinagl <oliver@...inagl.nl>
Subject: [PATCH] iopoll: Introduce ioreadX_poll_timeout[_atomic]
While the readX_poll_timeout[_atomic] macro's are great, we are actually
encouraged to use ioreadX where possible (LDDv3 C9) [0]. This patch
introduces macro's for our ioreadX friends.
[0]: https://www.oreilly.com/library/view/linux-device-drivers/0596005903/ch09.html
Signed-off-by: Olliver Schinagl <oliver@...inagl.nl>
---
include/linux/iopoll.h | 72 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 72 insertions(+)
diff --git a/include/linux/iopoll.h b/include/linux/iopoll.h
index 2c8860e406bd..0e1dbd8057f4 100644
--- a/include/linux/iopoll.h
+++ b/include/linux/iopoll.h
@@ -188,4 +188,76 @@
#define readq_relaxed_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \
readx_poll_timeout_atomic(readq_relaxed, addr, val, cond, delay_us, timeout_us)
+#define ioread8_poll_timeout(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout(ioread8, addr, val, cond, delay_us, timeout_us)
+
+#define ioread8be_poll_timeout(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout(ioread8be, addr, val, cond, delay_us, timeout_us)
+
+#define ioread8_rep_poll_timeout(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout(ioread8_rep, addr, val, cond, delay_us, timeout_us)
+
+#define ioread8_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout_atomic(ioread8, addr, val, cond, delay_us, timeout_us)
+
+#define ioread8be_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout_atomic(ioread8be, addr, val, cond, delay_us, timeout_us)
+
+#define ioread8_rep_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout_atomic(ioread8_rep, addr, val, cond, delay_us, timeout_us)
+
+#define ioread16_poll_timeout(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout(ioread16, addr, val, cond, delay_us, timeout_us)
+
+#define ioread16be_poll_timeout(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout(ioread16be, addr, val, cond, delay_us, timeout_us)
+
+#define ioread16_rep_poll_timeout(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout(ioread16_rep, addr, val, cond, delay_us, timeout_us)
+
+#define ioread16_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout_atomic(ioread16, addr, val, cond, delay_us, timeout_us)
+
+#define ioread16_rep_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout_atomic(ioread16_rep, addr, val, cond, delay_us, timeout_us)
+
+#define ioread16be_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout_atomic(ioread16be, addr, val, cond, delay_us, timeout_us)
+
+#define ioread32_poll_timeout(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout(ioread32, addr, val, cond, delay_us, timeout_us)
+
+#define ioread32be_poll_timeout(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout(ioread32be, addr, val, cond, delay_us, timeout_us)
+
+#define ioread32_rep_poll_timeout(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout(ioread32_rep, addr, val, cond, delay_us, timeout_us)
+
+#define ioread32_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout_atomic(ioread32, addr, val, cond, delay_us, timeout_us)
+
+#define ioread32be_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout_atomic(ioread32be, addr, val, cond, delay_us, timeout_us)
+
+#define ioread32_rep_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout_atomic(ioread32_rep, addr, val, cond, delay_us, timeout_us)
+
+#define ioread64_poll_timeout(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout(ioread64, addr, val, cond, delay_us, timeout_us)
+
+#define ioread64be_poll_timeout(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout(ioreab64be, addr, val, cond, delay_us, timeout_us)
+
+#define ioread64_rep_poll_timeout(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout(ioread64_rep, addr, val, cond, delay_us, timeout_us)
+
+#define ioread64_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout_atomic(ioread64, addr, val, cond, delay_us, timeout_us)
+
+#define ioread64be_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout_atomic(ioreab64be, addr, val, cond, delay_us, timeout_us)
+
+#define ioread64_rep_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \
+ readx_poll_timeout_atomic(ioread64_rep, addr, val, cond, delay_us, timeout_us)
+
#endif /* _LINUX_IOPOLL_H */
--
2.37.2
Powered by blists - more mailing lists