Lines Matching +full:sleep +full:- +full:hardware +full:- +full:state

1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Hardware spinlock public header
5 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com
7 * Contact: Ohad Ben-Cohen <ohad@wizery.com>
17 #define HWLOCK_IRQSTATE 0x01 /* Disable interrupts, save state */
18 #define HWLOCK_IRQ 0x02 /* Disable interrupts, don't save state */
29 * struct hwspinlock_pdata - platform data for hwspinlock drivers
32 * hwspinlock devices provide system-wide hardware locks that are used
35 * To achieve that, each physical lock must have a system-wide id number
37 * they're using the same hardware lock.
41 * (num-of-locks - 1).
94 * Note: ERR_PTR(-ENODEV) will still be considered a success for NULL-checking
99 return ERR_PTR(-ENODEV); in hwspin_lock_request()
104 return ERR_PTR(-ENODEV); in hwspin_lock_request_specific()
154 return ERR_PTR(-ENODEV); in devm_hwspin_lock_request()
161 return ERR_PTR(-ENODEV); in devm_hwspin_lock_request_specific()
167 * hwspin_trylock_irqsave() - try to lock an hwspinlock, disable interrupts
169 * @flags: a pointer to where the caller's interrupt state will be saved at
175 * interrupts are disabled (previous interrupts state is saved at @flags),
176 * so the caller must not sleep, and is advised to release the hwspinlock
179 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
180 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
189 * hwspin_trylock_irq() - try to lock an hwspinlock, disable interrupts
196 * interrupts are disabled, so the caller must not sleep, and is advised
199 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
200 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
208 * hwspin_trylock_raw() - attempt to lock a specific hwspinlock
214 * Caution: User must protect the routine of getting hardware lock with mutex
215 * or spinlock to avoid dead-lock, that will let user can do some time-consuming
216 * or sleepable operations under the hardware lock.
218 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
219 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
227 * hwspin_trylock_in_atomic() - attempt to lock a specific hwspinlock
235 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
236 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
244 * hwspin_trylock() - attempt to lock a specific hwspinlock
251 * so the caller must not sleep, and is advised to release the hwspinlock
253 * polling on the hardware interconnect.
255 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
256 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
264 * hwspin_lock_timeout_irqsave() - lock hwspinlock, with timeout, disable irqs
267 * @flags: a pointer to where the caller's interrupt state will be saved at
274 * are disabled (plus previous interrupt state is saved), so the caller must
275 * not sleep, and is advised to release the hwspinlock as soon as possible.
278 * error code otherwise (most notably an -ETIMEDOUT if the @hwlock is still
279 * busy after @timeout msecs). The function will never sleep.
288 * hwspin_lock_timeout_irq() - lock hwspinlock, with timeout, disable irqs
297 * are disabled so the caller must not sleep, and is advised to release the
301 * error code otherwise (most notably an -ETIMEDOUT if the @hwlock is still
302 * busy after @timeout msecs). The function will never sleep.
311 * hwspin_lock_timeout_raw() - lock an hwspinlock with timeout limit
319 * Caution: User must protect the routine of getting hardware lock with mutex
320 * or spinlock to avoid dead-lock, that will let user can do some time-consuming
321 * or sleepable operations under the hardware lock.
324 * error code otherwise (most notably an -ETIMEDOUT if the @hwlock is still
325 * busy after @timeout msecs). The function will never sleep.
334 * hwspin_lock_timeout_in_atomic() - lock an hwspinlock with timeout limit
346 * error code otherwise (most notably an -ETIMEDOUT if the @hwlock is still
347 * busy after @timeout msecs). The function will never sleep.
356 * hwspin_lock_timeout() - lock an hwspinlock with timeout limit
365 * so the caller must not sleep, and is advised to release the hwspinlock
368 * hardware interconnect.
371 * error code otherwise (most notably an -ETIMEDOUT if the @hwlock is still
372 * busy after @timeout msecs). The function will never sleep.
381 * hwspin_unlock_irqrestore() - unlock hwspinlock, restore irq state
382 * @hwlock: a previously-acquired hwspinlock which we want to unlock
383 * @flags: previous caller's interrupt state to restore
386 * restore the previous state of the local interrupts. It should be used
399 * hwspin_unlock_irq() - unlock hwspinlock, enable interrupts
400 * @hwlock: a previously-acquired hwspinlock which we want to unlock
415 * hwspin_unlock_raw() - unlock hwspinlock
416 * @hwlock: a previously-acquired hwspinlock which we want to unlock
430 * hwspin_unlock_in_atomic() - unlock hwspinlock
431 * @hwlock: a previously-acquired hwspinlock which we want to unlock
445 * hwspin_unlock() - unlock hwspinlock
446 * @hwlock: a previously-acquired hwspinlock which we want to unlock