public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/2] iopoll: Introduce ioreadXX_poll_timeout() macros
@ 2023-03-30 14:14 Andy Shevchenko
  2023-03-30 14:14 ` [PATCH v1 2/2] thunderbolt: Make use of ioread32_poll_timeout() Andy Shevchenko
  2023-03-31  8:12 ` [PATCH v1 1/2] iopoll: Introduce ioreadXX_poll_timeout() macros Olliver Schinagl
  0 siblings, 2 replies; 7+ messages in thread
From: Andy Shevchenko @ 2023-03-30 14:14 UTC (permalink / raw)
  To: Mika Westerberg, Andy Shevchenko, Olliver Schinagl, linux-usb,
	linux-kernel
  Cc: Andreas Noever, Michael Jamet, Yehezkel Bernat

From: Olliver Schinagl <oliver@schinagl.nl>

There are users in the Linux kernel that would benefit from using
ioreadXX_poll_timeout() macros, such as ioread32_poll_timeout().
Introduce those macros.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Co-developed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/iopoll.h | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/include/linux/iopoll.h b/include/linux/iopoll.h
index 2c8860e406bd..30ba609175a7 100644
--- a/include/linux/iopoll.h
+++ b/include/linux/iopoll.h
@@ -140,6 +140,7 @@
 #define readx_poll_timeout_atomic(op, addr, val, cond, delay_us, timeout_us) \
 	read_poll_timeout_atomic(op, val, cond, delay_us, timeout_us, false, addr)
 
+/* readX() */
 #define readb_poll_timeout(addr, val, cond, delay_us, timeout_us) \
 	readx_poll_timeout(readb, addr, val, cond, delay_us, timeout_us)
 
@@ -164,6 +165,7 @@
 #define readq_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \
 	readx_poll_timeout_atomic(readq, addr, val, cond, delay_us, timeout_us)
 
+/* readX_relaxed() */
 #define readb_relaxed_poll_timeout(addr, val, cond, delay_us, timeout_us) \
 	readx_poll_timeout(readb_relaxed, addr, val, cond, delay_us, timeout_us)
 
@@ -188,4 +190,29 @@
 #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)
 
+/* ioreadXX() */
+#define ioread8_poll_timeout(addr, val, cond, delay_us, timeout_us) \
+	readx_poll_timeout(ioread8, 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 ioread16_poll_timeout(addr, val, cond, delay_us, timeout_us) \
+	readx_poll_timeout(ioread16, 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 ioread32_poll_timeout(addr, val, cond, delay_us, timeout_us) \
+	readx_poll_timeout(ioread32, 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 ioread64_poll_timeout(addr, val, cond, delay_us, timeout_us) \
+	readx_poll_timeout(ioread64, 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)
+
 #endif /* _LINUX_IOPOLL_H */
-- 
2.40.0.1.gaa8946217a0b


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-04-05 11:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-30 14:14 [PATCH v1 1/2] iopoll: Introduce ioreadXX_poll_timeout() macros Andy Shevchenko
2023-03-30 14:14 ` [PATCH v1 2/2] thunderbolt: Make use of ioread32_poll_timeout() Andy Shevchenko
2023-03-31  8:12 ` [PATCH v1 1/2] iopoll: Introduce ioreadXX_poll_timeout() macros Olliver Schinagl
2023-04-05  8:58   ` Andy Shevchenko
2023-04-05  9:41     ` Mika Westerberg
2023-04-05 11:15       ` Andy Shevchenko
2023-04-05 11:18         ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox