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, rpm, ops) do { \
60 __intel_wakeref_init((wf), (rpm), (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
81 intel_wakeref_get(struct intel_wakeref *wf)
84 if (unlikely(!atomic_inc_not_zero(&wf->count)))
85 return __intel_wakeref_get_first(wf);
92 * @wf: the wakeref
100 __intel_wakeref_get(struct intel_wakeref *wf)
102 INTEL_WAKEREF_BUG_ON(atomic_read(&wf->count) <= 0);
103 atomic_inc(&wf->count);
108 * @wf: the wakeref
116 intel_wakeref_get_if_active(struct intel_wakeref *wf)
118 return atomic_inc_not_zero(&wf->count);
128 * @wf: the wakeref
142 __intel_wakeref_put(struct intel_wakeref *wf, unsigned long flags)
147 INTEL_WAKEREF_BUG_ON(atomic_read(&wf->count) <= 0);
148 if (unlikely(!atomic_add_unless(&wf->count, -1, 1)))
149 __intel_wakeref_put_last(wf, flags);
153 intel_wakeref_put(struct intel_wakeref *wf)
156 __intel_wakeref_put(wf, 0);
160 intel_wakeref_put_async(struct intel_wakeref *wf)
162 __intel_wakeref_put(wf, INTEL_WAKEREF_PUT_ASYNC);
166 intel_wakeref_put_delay(struct intel_wakeref *wf, unsigned long delay)
168 __intel_wakeref_put(wf,
175 * @wf: the wakeref
182 intel_wakeref_lock(struct intel_wakeref *wf)
183 __acquires(wf->mutex)
185 mutex_lock(&wf->mutex);
190 * @wf: the wakeref
195 intel_wakeref_unlock(struct intel_wakeref *wf)
196 __releases(wf->mutex)
198 mutex_unlock(&wf->mutex);
203 * @wf: the wakeref
205 * Waits for the active callback (under the @wf->mutex or another CPU) is
209 intel_wakeref_unlock_wait(struct intel_wakeref *wf)
211 mutex_lock(&wf->mutex);
212 mutex_unlock(&wf->mutex);
213 flush_delayed_work(&wf->work);
218 * @wf: the wakeref
223 intel_wakeref_is_active(const struct intel_wakeref *wf)
225 return READ_ONCE(wf->wakeref);
230 * @wf: the wakeref
233 __intel_wakeref_defer_park(struct intel_wakeref *wf)
235 lockdep_assert_held(&wf->mutex);
236 INTEL_WAKEREF_BUG_ON(atomic_read(&wf->count));
237 atomic_set_release(&wf->count, 1);
242 * @wf: the wakeref
251 int intel_wakeref_wait_for_idle(struct intel_wakeref *wf);
263 * @wf: the wakeref
276 void intel_wakeref_auto(struct intel_wakeref_auto *wf, unsigned long timeout);
278 void intel_wakeref_auto_init(struct intel_wakeref_auto *wf,
280 void intel_wakeref_auto_fini(struct intel_wakeref_auto *wf);