Lines Matching +full:wait +full:- +full:free +full:- +full:us
4 * Permission is hereby granted, free of charge, to any person obtaining a
43 #define FDO_BUG_URL "https://drm.pages.freedesktop.org/intel-docs/how-to-file-i915-bugs.html"
63 #define i915_inject_probe_failure(i915) i915_inject_probe_error((i915), -ENODEV)
67 drm_dbg(&(i915)->drm, fmt, ##__VA_ARGS__); \
69 drm_err(&(i915)->drm, fmt, ##__VA_ARGS__); \
78 start__ >= max__ || size__ > max__ - start__; \
90 start__ > max__ || size__ > max__ - start__; \
98 (typeof(ptr))(__v & -BIT(n)); \
101 #define ptr_unmask_bits(ptr, n) ((unsigned long)(ptr) & (BIT(n) - 1))
105 *(bits) = __v & (BIT(n) - 1); \
106 (typeof(ptr))(__v & -BIT(n)); \
111 GEM_BUG_ON(__bits & -BIT(n)); \
117 (typeof(ptr))(__v - 1); \
138 return a - b; in ptrdiff()
152 ((type __user *)(__mptr - offsetof(type, member))); })
165 * Returns: -EFAULT if not accessible, -EINVAL if !zero, or 0 on success.
169 get_user(mbz__, (U)) ? -EFAULT : mbz__ ? -EINVAL : 0; \
178 int __idx = ffs(mask) - 1; \
185 return (n != 0 && ((n & (n - 1)) == 0)); in is_power_of_2_u64()
191 first->prev = head; in __list_del_many()
192 WRITE_ONCE(head->next, first); in __list_del_many()
198 return READ_ONCE(list->next) == head; in list_is_last_rcu()
209 * If you need to wait X milliseconds between events A and B, but event B
220 * Don't re-read the value of "jiffies" every time since it may change in wait_remaining_ms_from_jiffies()
228 remaining_jiffies = target_jiffies - tmp_jiffies; in wait_remaining_ms_from_jiffies()
236 * __wait_for - magic wait macro
238 * Macro to help avoid open coding check/wait/timeout patterns. Note that it's
243 #define __wait_for(OP, COND, US, Wmin, Wmax) ({ \ argument
244 const ktime_t end__ = ktime_add_ns(ktime_get_raw(), 1000ll * (US)); \
245 long wait__ = (Wmin); /* recommended min for usleep is 10 us */ \
258 ret__ = -ETIMEDOUT; \
268 #define _wait_for(COND, US, Wmin, Wmax) __wait_for(, (COND), (US), (Wmin), \ argument
279 #define _wait_for_atomic(COND, US, ATOMIC) \ argument
281 int cpu, ret, timeout = (US) * 1000; \
299 if (now - base >= timeout) { \
300 ret = -ETIMEDOUT; \
307 timeout -= now - base; \
316 #define wait_for_us(COND, US) \ argument
319 BUILD_BUG_ON(!__builtin_constant_p(US)); \
320 if ((US) > 10) \
321 ret__ = _wait_for((COND), (US), 10, 10); \
323 ret__ = _wait_for_atomic((COND), (US), 0); \
327 #define wait_for_atomic_us(COND, US) \ argument
329 BUILD_BUG_ON(!__builtin_constant_p(US)); \
330 BUILD_BUG_ON((US) > 50000); \
331 _wait_for_atomic((COND), (US), 1); \
356 return READ_ONCE(t->expires); in timer_active()