Lines Matching +full:suspend +full:- +full:in +full:- +full:wait

2  * SPDX-License-Identifier: MIT
83 * the runtime pm wakeref and then call the intel_wakeref_ops->get()
86 * Note that intel_wakeref_ops->get() is allowed to fail, in which case
87 * the runtime-pm wakeref will be released and the acquisition unwound,
97 if (unlikely(!atomic_inc_not_zero(&wf->count))) in intel_wakeref_get()
115 INTEL_WAKEREF_BUG_ON(atomic_read(&wf->count) <= 0); in __intel_wakeref_get()
116 atomic_inc(&wf->count); in __intel_wakeref_get()
131 return atomic_inc_not_zero(&wf->count); in intel_wakeref_get_if_active()
142 might_lock(&wf->mutex); in intel_wakeref_might_get()
151 * the runtime pm wakeref will be released after the intel_wakeref_ops->put()
154 * Note that intel_wakeref_ops->put() is allowed to fail, in which case the
155 * runtime-pm wakeref is retained.
162 GENMASK(BITS_PER_LONG - 1, __INTEL_WAKEREF_PUT_LAST_BIT__) in __intel_wakeref_put()
164 INTEL_WAKEREF_BUG_ON(atomic_read(&wf->count) <= 0); in __intel_wakeref_put()
165 if (unlikely(!atomic_add_unless(&wf->count, -1, 1))) in __intel_wakeref_put()
193 might_lock(&wf->mutex); in intel_wakeref_might_put()
206 __acquires(wf->mutex) in intel_wakeref_lock()
208 mutex_lock(&wf->mutex); in intel_wakeref_lock()
219 __releases(wf->mutex) in intel_wakeref_unlock()
221 mutex_unlock(&wf->mutex); in intel_wakeref_unlock()
225 * intel_wakeref_unlock_wait: Wait until the active callback is complete
228 * Waits for the active callback (under the @wf->mutex or another CPU) is
234 mutex_lock(&wf->mutex); in intel_wakeref_unlock_wait()
235 mutex_unlock(&wf->mutex); in intel_wakeref_unlock_wait()
236 flush_delayed_work(&wf->work); in intel_wakeref_unlock_wait()
248 return READ_ONCE(wf->wakeref); in intel_wakeref_is_active()
258 lockdep_assert_held(&wf->mutex); in __intel_wakeref_defer_park()
259 INTEL_WAKEREF_BUG_ON(atomic_read(&wf->count)); in __intel_wakeref_defer_park()
260 atomic_set_release(&wf->count, 1); in __intel_wakeref_defer_park()
264 * intel_wakeref_wait_for_idle: Wait until the wakeref is idle
267 * Wait for the earlier asynchronous release of the wakeref. Note
268 * this will wait for any third party as well, so make sure you only wait
276 #define INTEL_WAKEREF_DEF ((intel_wakeref_t)(-1))
304 return intel_ref_tracker_alloc(&wf->debug); in intel_wakeref_track()
310 intel_ref_tracker_free(&wf->debug, handle); in intel_wakeref_untrack()
317 return -1; in intel_wakeref_track()
336 * intel_wakeref_auto: Delay the runtime-pm autosuspend
338 * @timeout: relative timeout in jiffies
340 * The runtime-pm core uses a suspend delay after the last wakeref
341 * is released before triggering runtime suspend of the device. That
348 * suspend immediately.