Lines Matching refs:hwspinlock

14 A generic hwspinlock framework allows platform-independent drivers to use
15 the hwspinlock device in order to access data structures that are shared
28 the remote processors, and access to it is synchronized using the hwspinlock
32 A common hwspinlock interface makes it possible to have generic, platform-
37 struct hwspinlock *hwspin_lock_request(void);
38 - dynamically assign an hwspinlock and return its address, or NULL
39 in case an unused hwspinlock isn't available. Users of this
44 struct hwspinlock *hwspin_lock_request_specific(unsigned int id);
45 - assign a specific hwspinlock id and return its address, or NULL
46 if that hwspinlock is already in use. Usually board code will
47 be calling this function in order to reserve specific hwspinlock
53 This function provides a means for DT users of a hwspinlock module
54 to get the global lock id of a specific hwspinlock, so that it can
57 the hwspinlock device is not yet registered with the core, or other
61 int hwspin_lock_free(struct hwspinlock *hwlock);
62 - free a previously-assigned hwspinlock; returns 0 on success, or an
63 appropriate error code on failure (e.g. -EINVAL if the hwspinlock
67 int hwspin_lock_timeout(struct hwspinlock *hwlock, unsigned int timeout);
68 - lock a previously-assigned hwspinlock with a timeout limit (specified in
69 msecs). If the hwspinlock is already taken, the function will busy loop
72 the caller must not sleep, and is advised to release the hwspinlock as
76 notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs).
79 int hwspin_lock_timeout_irq(struct hwspinlock *hwlock, unsigned int timeout);
80 - lock a previously-assigned hwspinlock with a timeout limit (specified in
81 msecs). If the hwspinlock is already taken, the function will busy loop
85 release the hwspinlock as soon as possible.
87 notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs).
90 int hwspin_lock_timeout_irqsave(struct hwspinlock *hwlock, unsigned int to,
92 - lock a previously-assigned hwspinlock with a timeout limit (specified in
93 msecs). If the hwspinlock is already taken, the function will busy loop
98 release the hwspinlock as soon as possible.
100 notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs).
103 int hwspin_trylock(struct hwspinlock *hwlock);
104 - attempt to lock a previously-assigned hwspinlock, but immediately fail if
107 caller must not sleep, and is advised to release the hwspinlock as soon as
111 notably -EBUSY if the hwspinlock was already taken).
114 int hwspin_trylock_irq(struct hwspinlock *hwlock);
115 - attempt to lock a previously-assigned hwspinlock, but immediately fail if
119 release the hwspinlock as soon as possible.
121 notably -EBUSY if the hwspinlock was already taken).
124 int hwspin_trylock_irqsave(struct hwspinlock *hwlock, unsigned long *flags);
125 - attempt to lock a previously-assigned hwspinlock, but immediately fail if
130 to release the hwspinlock as soon as possible.
132 notably -EBUSY if the hwspinlock was already taken).
135 void hwspin_unlock(struct hwspinlock *hwlock);
136 - unlock a previously-locked hwspinlock. Always succeed, and can be called
138 unlock an hwspinlock which is already unlocked (there is no protection
141 void hwspin_unlock_irq(struct hwspinlock *hwlock);
142 - unlock a previously-locked hwspinlock and enable local interrupts.
143 The caller should _never_ unlock an hwspinlock which is already unlocked.
149 hwspin_unlock_irqrestore(struct hwspinlock *hwlock, unsigned long *flags);
150 - unlock a previously-locked hwspinlock.
151 The caller should _never_ unlock an hwspinlock which is already unlocked.
157 int hwspin_lock_get_id(struct hwspinlock *hwlock);
158 - retrieve id number of a given hwspinlock. This is needed when an
159 hwspinlock is dynamically assigned: before it can be used to achieve
162 Returns the hwspinlock id number, or -EINVAL if hwlock is null.
166 #include <linux/hwspinlock.h>
171 struct hwspinlock *hwlock;
174 /* dynamically assign a hwspinlock */
204 struct hwspinlock *hwlock;
208 * assign a specific hwspinlock id - this should be called early
243 order to register a new hwspinlock device (which is usually a bank of
250 to unregister an hwspinlock device (which is usually a bank of numerous
253 Returns the address of hwspinlock on success, or NULL on error (e.g.
254 if the hwspinlock is still in use).
259 of hardware locks. It is registered by the underlying hwspinlock
265 * @ops: platform-specific hwspinlock handlers
268 * @lock: dynamically allocated array of 'struct hwspinlock'
275 struct hwspinlock lock[0];
278 struct hwspinlock_device contains an array of hwspinlock structs, each
282 * struct hwspinlock - this struct represents a single hwspinlock instance
284 * @lock: initialized and used by hwspinlock core
285 * @priv: private data, owned by the underlying platform-specific hwspinlock drv
287 struct hwspinlock {
293 When registering a bank of locks, the hwspinlock driver only needs to
295 initialized by the hwspinlock core itself.
302 int (*trylock)(struct hwspinlock *lock);
303 void (*unlock)(struct hwspinlock *lock);
304 void (*relax)(struct hwspinlock *lock);
315 The ->relax() callback is optional. It is called by hwspinlock core while