On Wed, Oct 08 2014 at 06:40:46 AM, Arnd Bergmann a...@arndb.de wrote:
On Tuesday 07 October 2014 18:47:59 Mitchel Humpherys wrote:
On Wed, Oct 01 2014 at 01:25:33 AM, Arnd Bergmann a...@arndb.de wrote:
On Tuesday 30 September 2014 18:28:12 Mitchel Humpherys wrote:
+ */
+#define
On Friday 10 October 2014 12:44:45 Mitchel Humpherys wrote:
Regarding the division, for the overwhelmingly common case where the
user of the API passes in a constant for sleep_us the compiler optimizes
out this calculation altogether and just sticks the final result in (I
verified this
On Tue, Oct 07 2014 at 06:47:59 PM, Mitchel Humpherys mitch...@codeaurora.org
wrote:
+#define readl_poll_timeout_atomic(addr, val, cond, max_reads,
time_between_us) \
+({ \
+ int count; \
+ for (count = (max_reads); count 0; count--) { \
+ (val) = readl(addr); \
On Tuesday 07 October 2014 18:47:59 Mitchel Humpherys wrote:
On Wed, Oct 01 2014 at 01:25:33 AM, Arnd Bergmann a...@arndb.de wrote:
On Tuesday 30 September 2014 18:28:12 Mitchel Humpherys wrote:
+ */
+#define readl_poll_timeout(addr, val, cond, sleep_us, timeout_us) \
+({ \
+
On Wed, Oct 01 2014 at 01:25:33 AM, Arnd Bergmann a...@arndb.de wrote:
On Tuesday 30 September 2014 18:28:12 Mitchel Humpherys wrote:
+ */
+#define readl_poll_timeout(addr, val, cond, sleep_us, timeout_us) \
+({ \
+ ktime_t timeout = ktime_add_us(ktime_get(), timeout_us); \
+
On Tuesday 30 September 2014 18:28:12 Mitchel Humpherys wrote:
+ */
+#define readl_poll_timeout(addr, val, cond, sleep_us, timeout_us) \
+({ \
+ ktime_t timeout = ktime_add_us(ktime_get(), timeout_us); \
+ might_sleep_if(timeout_us); \
Does it make sense to call this with
From: Matt Wagantall ma...@codeaurora.org
It is sometimes necessary to poll a memory-mapped register until its value
satisfies some condition. Introduce a family of convenience macros that do
this. Tight-looping, sleeping, and timing out can all be accomplished using
these macros.
Cc: Thierry