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 <[email protected]>
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).
95 * Note: ERR_PTR(-ENODEV) will still be considered a success for NULL-checking
100 return ERR_PTR(-ENODEV); in hwspin_lock_request()
105 return ERR_PTR(-ENODEV); in hwspin_lock_request_specific()
160 return ERR_PTR(-ENODEV); in devm_hwspin_lock_request()
167 return ERR_PTR(-ENODEV); in devm_hwspin_lock_request_specific()
173 * hwspin_trylock_irqsave() - try to lock an hwspinlock, disable interrupts
175 * @flags: a pointer to where the caller's interrupt state will be saved at
181 * interrupts are disabled (previous interrupts state is saved at @flags),
182 * so the caller must not sleep, and is advised to release the hwspinlock
185 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
186 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
195 * hwspin_trylock_irq() - try to lock an hwspinlock, disable interrupts
202 * interrupts are disabled, so the caller must not sleep, and is advised
205 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
206 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
214 * hwspin_trylock_raw() - attempt to lock a specific hwspinlock
220 * Caution: User must protect the routine of getting hardware lock with mutex
221 * or spinlock to avoid dead-lock, that will let user can do some time-consuming
222 * or sleepable operations under the hardware lock.
224 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
225 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
233 * hwspin_trylock_in_atomic() - attempt to lock a specific hwspinlock
241 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
242 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
250 * hwspin_trylock() - attempt to lock a specific hwspinlock
257 * so the caller must not sleep, and is advised to release the hwspinlock
259 * polling on the hardware interconnect.
261 * Returns 0 if we successfully locked the hwspinlock, -EBUSY if
262 * the hwspinlock was already taken, and -EINVAL if @hwlock is invalid.
270 * hwspin_lock_timeout_irqsave() - lock hwspinlock, with timeout, disable irqs
273 * @flags: a pointer to where the caller's interrupt state will be saved at
280 * are disabled (plus previous interrupt state is saved), so the caller must
281 * not sleep, and is advised to release the hwspinlock as soon as possible.
284 * error code otherwise (most notably an -ETIMEDOUT if the @hwlock is still
285 * busy after @timeout msecs). The function will never sleep.
294 * hwspin_lock_timeout_irq() - lock hwspinlock, with timeout, disable irqs
303 * are disabled so the caller must not sleep, and is advised to release the
307 * error code otherwise (most notably an -ETIMEDOUT if the @hwlock is still
308 * busy after @timeout msecs). The function will never sleep.
317 * hwspin_lock_timeout_raw() - lock an hwspinlock with timeout limit
325 * Caution: User must protect the routine of getting hardware lock with mutex
326 * or spinlock to avoid dead-lock, that will let user can do some time-consuming
327 * or sleepable operations under the hardware lock.
330 * error code otherwise (most notably an -ETIMEDOUT if the @hwlock is still
331 * busy after @timeout msecs). The function will never sleep.
340 * hwspin_lock_timeout_in_atomic() - lock an hwspinlock with timeout limit
352 * error code otherwise (most notably an -ETIMEDOUT if the @hwlock is still
353 * busy after @timeout msecs). The function will never sleep.
362 * hwspin_lock_timeout() - lock an hwspinlock with timeout limit
371 * so the caller must not sleep, and is advised to release the hwspinlock
374 * hardware interconnect.
377 * error code otherwise (most notably an -ETIMEDOUT if the @hwlock is still
378 * busy after @timeout msecs). The function will never sleep.
387 * hwspin_unlock_irqrestore() - unlock hwspinlock, restore irq state
388 * @hwlock: a previously-acquired hwspinlock which we want to unlock
389 * @flags: previous caller's interrupt state to restore
392 * restore the previous state of the local interrupts. It should be used
405 * hwspin_unlock_irq() - unlock hwspinlock, enable interrupts
406 * @hwlock: a previously-acquired hwspinlock which we want to unlock
421 * hwspin_unlock_raw() - unlock hwspinlock
422 * @hwlock: a previously-acquired hwspinlock which we want to unlock
436 * hwspin_unlock_in_atomic() - unlock hwspinlock
437 * @hwlock: a previously-acquired hwspinlock which we want to unlock
451 * hwspin_unlock() - unlock hwspinlock
452 * @hwlock: a previously-acquired hwspinlock which we want to unlock