Lines Matching refs:wf

32 	int (*get)(struct intel_wakeref *wf);
33 int (*put)(struct intel_wakeref *wf);
53 void __intel_wakeref_init(struct intel_wakeref *wf,
57 #define intel_wakeref_init(wf, i915, ops) do { \
60 __intel_wakeref_init((wf), (i915), (ops), &__key); \
63 int __intel_wakeref_get_first(struct intel_wakeref *wf);
64 void __intel_wakeref_put_last(struct intel_wakeref *wf, unsigned long flags);
68 * @wf: the wakeref
82 intel_wakeref_get(struct intel_wakeref *wf)
85 if (unlikely(!atomic_inc_not_zero(&wf->count)))
86 return __intel_wakeref_get_first(wf);
93 * @wf: the wakeref
101 __intel_wakeref_get(struct intel_wakeref *wf)
103 INTEL_WAKEREF_BUG_ON(atomic_read(&wf->count) <= 0);
104 atomic_inc(&wf->count);
109 * @wf: the wakeref
117 intel_wakeref_get_if_active(struct intel_wakeref *wf)
119 return atomic_inc_not_zero(&wf->count);
128 intel_wakeref_might_get(struct intel_wakeref *wf)
130 might_lock(&wf->mutex);
135 * @wf: the wakeref
147 __intel_wakeref_put(struct intel_wakeref *wf, unsigned long flags)
152 INTEL_WAKEREF_BUG_ON(atomic_read(&wf->count) <= 0);
153 if (unlikely(!atomic_add_unless(&wf->count, -1, 1)))
154 __intel_wakeref_put_last(wf, flags);
158 intel_wakeref_put(struct intel_wakeref *wf)
161 __intel_wakeref_put(wf, 0);
165 intel_wakeref_put_async(struct intel_wakeref *wf)
167 __intel_wakeref_put(wf, INTEL_WAKEREF_PUT_ASYNC);
171 intel_wakeref_put_delay(struct intel_wakeref *wf, unsigned long delay)
173 __intel_wakeref_put(wf,
179 intel_wakeref_might_put(struct intel_wakeref *wf)
181 might_lock(&wf->mutex);
186 * @wf: the wakeref
193 intel_wakeref_lock(struct intel_wakeref *wf)
194 __acquires(wf->mutex)
196 mutex_lock(&wf->mutex);
201 * @wf: the wakeref
206 intel_wakeref_unlock(struct intel_wakeref *wf)
207 __releases(wf->mutex)
209 mutex_unlock(&wf->mutex);
214 * @wf: the wakeref
216 * Waits for the active callback (under the @wf->mutex or another CPU) is
220 intel_wakeref_unlock_wait(struct intel_wakeref *wf)
222 mutex_lock(&wf->mutex);
223 mutex_unlock(&wf->mutex);
224 flush_delayed_work(&wf->work);
229 * @wf: the wakeref
234 intel_wakeref_is_active(const struct intel_wakeref *wf)
236 return READ_ONCE(wf->wakeref);
241 * @wf: the wakeref
244 __intel_wakeref_defer_park(struct intel_wakeref *wf)
246 lockdep_assert_held(&wf->mutex);
247 INTEL_WAKEREF_BUG_ON(atomic_read(&wf->count));
248 atomic_set_release(&wf->count, 1);
253 * @wf: the wakeref
262 int intel_wakeref_wait_for_idle(struct intel_wakeref *wf);
274 * @wf: the wakeref
287 void intel_wakeref_auto(struct intel_wakeref_auto *wf, unsigned long timeout);
289 void intel_wakeref_auto_init(struct intel_wakeref_auto *wf,
291 void intel_wakeref_auto_fini(struct intel_wakeref_auto *wf);