Lines Matching +full:autosuspend +full:- +full:delay

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()
183 intel_wakeref_put_delay(struct intel_wakeref *wf, unsigned long delay) in intel_wakeref_put_delay() argument
187 FIELD_PREP(INTEL_WAKEREF_PUT_DELAY, delay)); in intel_wakeref_put_delay()
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()
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()
276 #define INTEL_WAKEREF_DEF ERR_PTR(-ENOENT)
306 return intel_ref_tracker_alloc(&wf->debug); in intel_wakeref_track()
312 intel_ref_tracker_free(&wf->debug, handle); in intel_wakeref_untrack()
338 * intel_wakeref_auto: Delay the runtime-pm autosuspend
342 * The runtime-pm core uses a suspend delay after the last wakeref
344 * delay is configurable via sysfs with little regard to the device
345 * characteristics. Instead, we want to tune the autosuspend based on our
349 * Pass @timeout = 0 to cancel a previous autosuspend by executing the