Lines Matching refs:hwspinlock

17 A generic hwspinlock framework allows platform-independent drivers to use
18 the hwspinlock device in order to access data structures that are shared
31 the remote processors, and access to it is synchronized using the hwspinlock
35 A common hwspinlock interface makes it possible to have generic, platform-
43 struct hwspinlock *hwspin_lock_request(void);
45 Dynamically assign an hwspinlock and return its address, or NULL
46 in case an unused hwspinlock isn't available. Users of this
54 struct hwspinlock *hwspin_lock_request_specific(unsigned int id);
56 Assign a specific hwspinlock id and return its address, or NULL
57 if that hwspinlock is already in use. Usually board code will
58 be calling this function in order to reserve specific hwspinlock
68 This function provides a means for DT users of a hwspinlock module
69 to get the global lock id of a specific hwspinlock, so that it can
73 the hwspinlock device is not yet registered with the core, or other
80 int hwspin_lock_free(struct hwspinlock *hwlock);
82 Free a previously-assigned hwspinlock; returns 0 on success, or an
83 appropriate error code on failure (e.g. -EINVAL if the hwspinlock
90 int hwspin_lock_timeout(struct hwspinlock *hwlock, unsigned int timeout);
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
96 the caller must not sleep, and is advised to release the hwspinlock as
101 notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs).
106 int hwspin_lock_timeout_irq(struct hwspinlock *hwlock, unsigned int timeout);
108 Lock a previously-assigned hwspinlock with a timeout limit (specified in
109 msecs). If the hwspinlock is already taken, the function will busy loop
113 release the hwspinlock as soon as possible.
116 notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs).
121 int hwspin_lock_timeout_irqsave(struct hwspinlock *hwlock, unsigned int to,
124 Lock a previously-assigned hwspinlock with a timeout limit (specified in
125 msecs). If the hwspinlock is already taken, the function will busy loop
130 release the hwspinlock as soon as possible.
133 notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs).
139 int hwspin_trylock(struct hwspinlock *hwlock);
142 Attempt to lock a previously-assigned hwspinlock, but immediately fail if
146 caller must not sleep, and is advised to release the hwspinlock as soon as
151 notably -EBUSY if the hwspinlock was already taken).
156 int hwspin_trylock_irq(struct hwspinlock *hwlock);
159 Attempt to lock a previously-assigned hwspinlock, but immediately fail if
164 release the hwspinlock as soon as possible.
167 notably -EBUSY if the hwspinlock was already taken).
173 int hwspin_trylock_irqsave(struct hwspinlock *hwlock, unsigned long *flags);
175 Attempt to lock a previously-assigned hwspinlock, but immediately fail if
181 to release the hwspinlock as soon as possible.
184 notably -EBUSY if the hwspinlock was already taken).
189 void hwspin_unlock(struct hwspinlock *hwlock);
191 Unlock a previously-locked hwspinlock. Always succeed, and can be called
196 code should **never** unlock an hwspinlock which is already unlocked
201 void hwspin_unlock_irq(struct hwspinlock *hwlock);
203 Unlock a previously-locked hwspinlock and enable local interrupts.
204 The caller should **never** unlock an hwspinlock which is already unlocked.
213 hwspin_unlock_irqrestore(struct hwspinlock *hwlock, unsigned long *flags);
215 Unlock a previously-locked hwspinlock.
217 The caller should **never** unlock an hwspinlock which is already unlocked.
225 int hwspin_lock_get_id(struct hwspinlock *hwlock);
227 Retrieve id number of a given hwspinlock. This is needed when an
228 hwspinlock is dynamically assigned: before it can be used to achieve
232 Returns the hwspinlock id number, or -EINVAL if hwlock is null.
239 #include <linux/hwspinlock.h>
244 struct hwspinlock *hwlock;
247 /* dynamically assign a hwspinlock */
277 struct hwspinlock *hwlock;
281 * assign a specific hwspinlock id - this should be called early
320 order to register a new hwspinlock device (which is usually a bank of
331 to unregister an hwspinlock device (which is usually a bank of numerous
336 Returns the address of hwspinlock on success, or NULL on error (e.g.
337 if the hwspinlock is still in use).
343 of hardware locks. It is registered by the underlying hwspinlock
351 * @ops: platform-specific hwspinlock handlers
354 * @lock: dynamically allocated array of 'struct hwspinlock'
361 struct hwspinlock lock[0];
364 struct hwspinlock_device contains an array of hwspinlock structs, each
368 * struct hwspinlock - this struct represents a single hwspinlock instance
370 * @lock: initialized and used by hwspinlock core
371 * @priv: private data, owned by the underlying platform-specific hwspinlock drv
373 struct hwspinlock {
379 When registering a bank of locks, the hwspinlock driver only needs to
381 initialized by the hwspinlock core itself.
389 int (*trylock)(struct hwspinlock *lock);
390 void (*unlock)(struct hwspinlock *lock);
391 void (*relax)(struct hwspinlock *lock);
402 The ->relax() callback is optional. It is called by hwspinlock core while