€•T¯Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ&/translations/zh_CN/locking/hwspinlock”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/zh_TW/locking/hwspinlock”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/it_IT/locking/hwspinlock”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/ja_JP/locking/hwspinlock”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/ko_KR/locking/hwspinlock”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/pt_BR/locking/hwspinlock”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/sp_SP/locking/hwspinlock”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒHardware Spinlock Framework”h]”hŒHardware Spinlock Framework”…””}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³Œ@/var/lib/git/docbuild/linux/Documentation/locking/hwspinlock.rst”h´Kubh¶)”}”(hhh]”(h»)”}”(hŒ Introduction”h]”hŒ Introduction”…””}”(hhÎh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhhËh²hh³hÊh´KubhŒ paragraph”“”)”}”(hŒÀHardware spinlock modules provide hardware assistance for synchronization and mutual exclusion between heterogeneous processors and those not operating under a single, shared operating system.”h]”hŒÀHardware spinlock modules provide hardware assistance for synchronization and mutual exclusion between heterogeneous processors and those not operating under a single, shared operating system.”…””}”(hhÞh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KhhËh²hubhÝ)”}”(hŒöFor example, OMAP4 has dual Cortex-A9, dual Cortex-M3 and a C64x+ DSP, each of which is running a different Operating System (the master, A9, is usually running Linux and the slave processors, the M3 and the DSP, are running some flavor of RTOS).”h]”hŒöFor example, OMAP4 has dual Cortex-A9, dual Cortex-M3 and a C64x+ DSP, each of which is running a different Operating System (the master, A9, is usually running Linux and the slave processors, the M3 and the DSP, are running some flavor of RTOS).”…””}”(hhìh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K hhËh²hubhÝ)”}”(hXA generic hwspinlock framework allows platform-independent drivers to use the hwspinlock device in order to access data structures that are shared between remote processors, that otherwise have no alternative mechanism to accomplish synchronization and mutual exclusion operations.”h]”hXA generic hwspinlock framework allows platform-independent drivers to use the hwspinlock device in order to access data structures that are shared between remote processors, that otherwise have no alternative mechanism to accomplish synchronization and mutual exclusion operations.”…””}”(hhúh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KhhËh²hubhÝ)”}”(hŒÛThis is necessary, for example, for Inter-processor communications: on OMAP4, cpu-intensive multimedia tasks are offloaded by the host to the remote M3 and/or C64x+ slave processors (by an IPC subsystem called Syslink).”h]”hŒÛThis is necessary, for example, for Inter-processor communications: on OMAP4, cpu-intensive multimedia tasks are offloaded by the host to the remote M3 and/or C64x+ slave processors (by an IPC subsystem called Syslink).”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KhhËh²hubhÝ)”}”(hŒ¦To achieve fast message-based communications, a minimal kernel support is needed to deliver messages arriving from a remote processor to the appropriate user process.”h]”hŒ¦To achieve fast message-based communications, a minimal kernel support is needed to deliver messages arriving from a remote processor to the appropriate user process.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KhhËh²hubhÝ)”}”(hŒïThis communication is based on simple data structures that is shared between the remote processors, and access to it is synchronized using the hwspinlock module (remote processor directly places new messages in this shared data structure).”h]”hŒïThis communication is based on simple data structures that is shared between the remote processors, and access to it is synchronized using the hwspinlock module (remote processor directly places new messages in this shared data structure).”…””}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KhhËh²hubhÝ)”}”(hŒ`A common hwspinlock interface makes it possible to have generic, platform- independent, drivers.”h]”hŒ`A common hwspinlock interface makes it possible to have generic, platform- independent, drivers.”…””}”(hj2h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K#hhËh²hubeh}”(h]”Œ introduction”ah ]”h"]”Œ introduction”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)”}”(hhh]”(h»)”}”(hŒUser API”h]”hŒUser API”…””}”(hjKh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjHh²hh³hÊh´K'ubhŒ literal_block”“”)”}”(hŒAstruct hwspinlock *hwspin_lock_request_specific(unsigned int id);”h]”hŒAstruct hwspinlock *hwspin_lock_request_specific(unsigned int id);”…””}”hj[sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1jYh³hÊh´K+hjHh²hubhÝ)”}”(hŒÛAssign a specific hwspinlock id and return its address, or NULL if that hwspinlock is already in use. Usually board code will be calling this function in order to reserve specific hwspinlock ids for predefined purposes.”h]”hŒÛAssign a specific hwspinlock id and return its address, or NULL if that hwspinlock is already in use. Usually board code will be calling this function in order to reserve specific hwspinlock ids for predefined purposes.”…””}”(hjkh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K-hjHh²hubhÝ)”}”(hŒ6Should be called from a process context (might sleep).”h]”hŒ6Should be called from a process context (might sleep).”…””}”(hjyh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K2hjHh²hubjZ)”}”(hŒ=int of_hwspin_lock_get_id(struct device_node *np, int index);”h]”hŒ=int of_hwspin_lock_get_id(struct device_node *np, int index);”…””}”hj‡sbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´K6hjHh²hubhÝ)”}”(hX Retrieve the global lock id for an OF phandle-based specific lock. This function provides a means for DT users of a hwspinlock module to get the global lock id of a specific hwspinlock, so that it can be requested using the normal hwspin_lock_request_specific() API.”h]”hX Retrieve the global lock id for an OF phandle-based specific lock. This function provides a means for DT users of a hwspinlock module to get the global lock id of a specific hwspinlock, so that it can be requested using the normal hwspin_lock_request_specific() API.”…””}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K8hjHh²hubhÝ)”}”(hŒ”The function returns a lock id number on success, -EPROBE_DEFER if the hwspinlock device is not yet registered with the core, or other error values.”h]”hŒ”The function returns a lock id number on success, -EPROBE_DEFER if the hwspinlock device is not yet registered with the core, or other error values.”…””}”(hj£h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K=hjHh²hubhÝ)”}”(hŒ6Should be called from a process context (might sleep).”h]”hŒ6Should be called from a process context (might sleep).”…””}”(hj±h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KAhjHh²hubjZ)”}”(hŒ0int hwspin_lock_free(struct hwspinlock *hwlock);”h]”hŒ0int hwspin_lock_free(struct hwspinlock *hwlock);”…””}”hj¿sbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´KEhjHh²hubhÝ)”}”(hŒ–Free a previously-assigned hwspinlock; returns 0 on success, or an appropriate error code on failure (e.g. -EINVAL if the hwspinlock is already free).”h]”hŒ–Free a previously-assigned hwspinlock; returns 0 on success, or an appropriate error code on failure (e.g. -EINVAL if the hwspinlock is already free).”…””}”(hjÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KGhjHh²hubhÝ)”}”(hŒ6Should be called from a process context (might sleep).”h]”hŒ6Should be called from a process context (might sleep).”…””}”(hjÛh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KKhjHh²hubjZ)”}”(hŒAint hwspin_lock_bust(struct hwspinlock *hwlock, unsigned int id);”h]”hŒAint hwspin_lock_bust(struct hwspinlock *hwlock, unsigned int id);”…””}”hjésbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´KOhjHh²hubhÝ)”}”(hŒéAfter verifying the owner of the hwspinlock, release a previously acquired hwspinlock; returns 0 on success, or an appropriate error code on failure (e.g. -EOPNOTSUPP if the bust operation is not defined for the specific hwspinlock).”h]”hŒéAfter verifying the owner of the hwspinlock, release a previously acquired hwspinlock; returns 0 on success, or an appropriate error code on failure (e.g. -EOPNOTSUPP if the bust operation is not defined for the specific hwspinlock).”…””}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KQhjHh²hubhÝ)”}”(hŒ6Should be called from a process context (might sleep).”h]”hŒ6Should be called from a process context (might sleep).”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KVhjHh²hubjZ)”}”(hŒIint hwspin_lock_timeout(struct hwspinlock *hwlock, unsigned int timeout);”h]”hŒIint hwspin_lock_timeout(struct hwspinlock *hwlock, unsigned int timeout);”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´KZhjHh²hubhÝ)”}”(hX½Lock a previously-assigned hwspinlock with a timeout limit (specified in msecs). If the hwspinlock is already taken, the function will busy loop waiting for it to be released, but give up when the timeout elapses. Upon a successful return from this function, preemption is disabled so the caller must not sleep, and is advised to release the hwspinlock as soon as possible, in order to minimize remote cores polling on the hardware interconnect.”h]”hX½Lock a previously-assigned hwspinlock with a timeout limit (specified in msecs). If the hwspinlock is already taken, the function will busy loop waiting for it to be released, but give up when the timeout elapses. Upon a successful return from this function, preemption is disabled so the caller must not sleep, and is advised to release the hwspinlock as soon as possible, in order to minimize remote cores polling on the hardware interconnect.”…””}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K\hjHh²hubhÝ)”}”(hŒ¯Returns 0 when successful and an appropriate error code otherwise (most notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs). The function will never sleep.”h]”hŒ¯Returns 0 when successful and an appropriate error code otherwise (most notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs). The function will never sleep.”…””}”(hj/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KdhjHh²hubjZ)”}”(hŒMint hwspin_lock_timeout_irq(struct hwspinlock *hwlock, unsigned int timeout);”h]”hŒMint hwspin_lock_timeout_irq(struct hwspinlock *hwlock, unsigned int timeout);”…””}”hj=sbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´KjhjHh²hubhÝ)”}”(hXLock a previously-assigned hwspinlock with a timeout limit (specified in msecs). If the hwspinlock is already taken, the function will busy loop waiting for it to be released, but give up when the timeout elapses. Upon a successful return from this function, preemption and the local interrupts are disabled, so the caller must not sleep, and is advised to release the hwspinlock as soon as possible.”h]”hXLock a previously-assigned hwspinlock with a timeout limit (specified in msecs). If the hwspinlock is already taken, the function will busy loop waiting for it to be released, but give up when the timeout elapses. Upon a successful return from this function, preemption and the local interrupts are disabled, so the caller must not sleep, and is advised to release the hwspinlock as soon as possible.”…””}”(hjKh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KlhjHh²hubhÝ)”}”(hŒ¯Returns 0 when successful and an appropriate error code otherwise (most notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs). The function will never sleep.”h]”hŒ¯Returns 0 when successful and an appropriate error code otherwise (most notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs). The function will never sleep.”…””}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KshjHh²hubjZ)”}”(hŒ‚int hwspin_lock_timeout_irqsave(struct hwspinlock *hwlock, unsigned int to, unsigned long *flags);”h]”hŒ‚int hwspin_lock_timeout_irqsave(struct hwspinlock *hwlock, unsigned int to, unsigned long *flags);”…””}”hjgsbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´KyhjHh²hubhÝ)”}”(hXÓLock a previously-assigned hwspinlock with a timeout limit (specified in msecs). If the hwspinlock is already taken, the function will busy loop waiting for it to be released, but give up when the timeout elapses. Upon a successful return from this function, preemption is disabled, local interrupts are disabled and their previous state is saved at the given flags placeholder. The caller must not sleep, and is advised to release the hwspinlock as soon as possible.”h]”hXÓLock a previously-assigned hwspinlock with a timeout limit (specified in msecs). If the hwspinlock is already taken, the function will busy loop waiting for it to be released, but give up when the timeout elapses. Upon a successful return from this function, preemption is disabled, local interrupts are disabled and their previous state is saved at the given flags placeholder. The caller must not sleep, and is advised to release the hwspinlock as soon as possible.”…””}”(hjuh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K|hjHh²hubhÝ)”}”(hŒReturns 0 when successful and an appropriate error code otherwise (most notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs).”h]”hŒReturns 0 when successful and an appropriate error code otherwise (most notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs).”…””}”(hjƒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K„hjHh²hubhÝ)”}”(hŒThe function will never sleep.”h]”hŒThe function will never sleep.”…””}”(hj‘h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K‡hjHh²hubjZ)”}”(hŒMint hwspin_lock_timeout_raw(struct hwspinlock *hwlock, unsigned int timeout);”h]”hŒMint hwspin_lock_timeout_raw(struct hwspinlock *hwlock, unsigned int timeout);”…””}”hjŸsbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´K‹hjHh²hubhÝ)”}”(hŒÕLock a previously-assigned hwspinlock with a timeout limit (specified in msecs). If the hwspinlock is already taken, the function will busy loop waiting for it to be released, but give up when the timeout elapses.”h]”hŒÕLock a previously-assigned hwspinlock with a timeout limit (specified in msecs). If the hwspinlock is already taken, the function will busy loop waiting for it to be released, but give up when the timeout elapses.”…””}”(hj­h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KhjHh²hubhÝ)”}”(hŒÉCaution: User must protect the routine of getting hardware lock with mutex or spinlock to avoid dead-lock, that will let user can do some time-consuming or sleepable operations under the hardware lock.”h]”hŒÉCaution: User must protect the routine of getting hardware lock with mutex or spinlock to avoid dead-lock, that will let user can do some time-consuming or sleepable operations under the hardware lock.”…””}”(hj»h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K‘hjHh²hubhÝ)”}”(hŒReturns 0 when successful and an appropriate error code otherwise (most notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs).”h]”hŒReturns 0 when successful and an appropriate error code otherwise (most notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs).”…””}”(hjÉh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K•hjHh²hubhÝ)”}”(hŒThe function will never sleep.”h]”hŒThe function will never sleep.”…””}”(hj×h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K˜hjHh²hubjZ)”}”(hŒNint hwspin_lock_timeout_in_atomic(struct hwspinlock *hwlock, unsigned int to);”h]”hŒNint hwspin_lock_timeout_in_atomic(struct hwspinlock *hwlock, unsigned int to);”…””}”hjåsbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´KœhjHh²hubhÝ)”}”(hŒÕLock a previously-assigned hwspinlock with a timeout limit (specified in msecs). If the hwspinlock is already taken, the function will busy loop waiting for it to be released, but give up when the timeout elapses.”h]”hŒÕLock a previously-assigned hwspinlock with a timeout limit (specified in msecs). If the hwspinlock is already taken, the function will busy loop waiting for it to be released, but give up when the timeout elapses.”…””}”(hjóh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KžhjHh²hubhÝ)”}”(hŒmThis function shall be called only from an atomic context and the timeout value shall not exceed a few msecs.”h]”hŒmThis function shall be called only from an atomic context and the timeout value shall not exceed a few msecs.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K¢hjHh²hubhÝ)”}”(hŒReturns 0 when successful and an appropriate error code otherwise (most notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs).”h]”hŒReturns 0 when successful and an appropriate error code otherwise (most notably -ETIMEDOUT if the hwspinlock is still busy after timeout msecs).”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K¥hjHh²hubhÝ)”}”(hŒThe function will never sleep.”h]”hŒThe function will never sleep.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K¨hjHh²hubjZ)”}”(hŒ.int hwspin_trylock(struct hwspinlock *hwlock);”h]”hŒ.int hwspin_trylock(struct hwspinlock *hwlock);”…””}”hj+sbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´K¬hjHh²hubhÝ)”}”(hŒ^Attempt to lock a previously-assigned hwspinlock, but immediately fail if it is already taken.”h]”hŒ^Attempt to lock a previously-assigned hwspinlock, but immediately fail if it is already taken.”…””}”(hj9h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K¯hjHh²hubhÝ)”}”(hŒãUpon a successful return from this function, preemption is disabled so caller must not sleep, and is advised to release the hwspinlock as soon as possible, in order to minimize remote cores polling on the hardware interconnect.”h]”hŒãUpon a successful return from this function, preemption is disabled so caller must not sleep, and is advised to release the hwspinlock as soon as possible, in order to minimize remote cores polling on the hardware interconnect.”…””}”(hjGh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K²hjHh²hubhÝ)”}”(hŒ–Returns 0 on success and an appropriate error code otherwise (most notably -EBUSY if the hwspinlock was already taken). The function will never sleep.”h]”hŒ–Returns 0 on success and an appropriate error code otherwise (most notably -EBUSY if the hwspinlock was already taken). The function will never sleep.”…””}”(hjUh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´K·hjHh²hubjZ)”}”(hŒ2int hwspin_trylock_irq(struct hwspinlock *hwlock);”h]”hŒ2int hwspin_trylock_irq(struct hwspinlock *hwlock);”…””}”hjcsbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´K½hjHh²hubhÝ)”}”(hŒ^Attempt to lock a previously-assigned hwspinlock, but immediately fail if it is already taken.”h]”hŒ^Attempt to lock a previously-assigned hwspinlock, but immediately fail if it is already taken.”…””}”(hjqh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÀhjHh²hubhÝ)”}”(hŒµUpon a successful return from this function, preemption and the local interrupts are disabled so caller must not sleep, and is advised to release the hwspinlock as soon as possible.”h]”hŒµUpon a successful return from this function, preemption and the local interrupts are disabled so caller must not sleep, and is advised to release the hwspinlock as soon as possible.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÃhjHh²hubhÝ)”}”(hŒwReturns 0 on success and an appropriate error code otherwise (most notably -EBUSY if the hwspinlock was already taken).”h]”hŒwReturns 0 on success and an appropriate error code otherwise (most notably -EBUSY if the hwspinlock was already taken).”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÇhjHh²hubhÝ)”}”(hŒThe function will never sleep.”h]”hŒThe function will never sleep.”…””}”(hj›h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÊhjHh²hubjZ)”}”(hŒLint hwspin_trylock_irqsave(struct hwspinlock *hwlock, unsigned long *flags);”h]”hŒLint hwspin_trylock_irqsave(struct hwspinlock *hwlock, unsigned long *flags);”…””}”hj©sbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´KÎhjHh²hubhÝ)”}”(hŒ^Attempt to lock a previously-assigned hwspinlock, but immediately fail if it is already taken.”h]”hŒ^Attempt to lock a previously-assigned hwspinlock, but immediately fail if it is already taken.”…””}”(hj·h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÐhjHh²hubhÝ)”}”(hXUpon a successful return from this function, preemption is disabled, the local interrupts are disabled and their previous state is saved at the given flags placeholder. The caller must not sleep, and is advised to release the hwspinlock as soon as possible.”h]”hXUpon a successful return from this function, preemption is disabled, the local interrupts are disabled and their previous state is saved at the given flags placeholder. The caller must not sleep, and is advised to release the hwspinlock as soon as possible.”…””}”(hjÅh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KÓhjHh²hubhÝ)”}”(hŒ–Returns 0 on success and an appropriate error code otherwise (most notably -EBUSY if the hwspinlock was already taken). The function will never sleep.”h]”hŒ–Returns 0 on success and an appropriate error code otherwise (most notably -EBUSY if the hwspinlock was already taken). The function will never sleep.”…””}”(hjÓh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KØhjHh²hubjZ)”}”(hŒ2int hwspin_trylock_raw(struct hwspinlock *hwlock);”h]”hŒ2int hwspin_trylock_raw(struct hwspinlock *hwlock);”…””}”hjásbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´KÞhjHh²hubhÝ)”}”(hŒ^Attempt to lock a previously-assigned hwspinlock, but immediately fail if it is already taken.”h]”hŒ^Attempt to lock a previously-assigned hwspinlock, but immediately fail if it is already taken.”…””}”(hjïh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KàhjHh²hubhÝ)”}”(hŒÉCaution: User must protect the routine of getting hardware lock with mutex or spinlock to avoid dead-lock, that will let user can do some time-consuming or sleepable operations under the hardware lock.”h]”hŒÉCaution: User must protect the routine of getting hardware lock with mutex or spinlock to avoid dead-lock, that will let user can do some time-consuming or sleepable operations under the hardware lock.”…””}”(hjýh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KãhjHh²hubhÝ)”}”(hŒ–Returns 0 on success and an appropriate error code otherwise (most notably -EBUSY if the hwspinlock was already taken). The function will never sleep.”h]”hŒ–Returns 0 on success and an appropriate error code otherwise (most notably -EBUSY if the hwspinlock was already taken). The function will never sleep.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KçhjHh²hubjZ)”}”(hŒ8int hwspin_trylock_in_atomic(struct hwspinlock *hwlock);”h]”hŒ8int hwspin_trylock_in_atomic(struct hwspinlock *hwlock);”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´KíhjHh²hubhÝ)”}”(hŒ^Attempt to lock a previously-assigned hwspinlock, but immediately fail if it is already taken.”h]”hŒ^Attempt to lock a previously-assigned hwspinlock, but immediately fail if it is already taken.”…””}”(hj'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KïhjHh²hubhÝ)”}”(hŒ:This function shall be called only from an atomic context.”h]”hŒ:This function shall be called only from an atomic context.”…””}”(hj5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KòhjHh²hubhÝ)”}”(hŒ–Returns 0 on success and an appropriate error code otherwise (most notably -EBUSY if the hwspinlock was already taken). The function will never sleep.”h]”hŒ–Returns 0 on success and an appropriate error code otherwise (most notably -EBUSY if the hwspinlock was already taken). The function will never sleep.”…””}”(hjCh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KôhjHh²hubjZ)”}”(hŒ.void hwspin_unlock(struct hwspinlock *hwlock);”h]”hŒ.void hwspin_unlock(struct hwspinlock *hwlock);”…””}”hjQsbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´KúhjHh²hubhÝ)”}”(hŒvUnlock a previously-locked hwspinlock. Always succeed, and can be called from any context (the function never sleeps).”h]”hŒvUnlock a previously-locked hwspinlock. Always succeed, and can be called from any context (the function never sleeps).”…””}”(hj_h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´KühjHh²hubhŒnote”“”)”}”(hŒkcode should **never** unlock an hwspinlock which is already unlocked (there is no protection against this).”h]”hÝ)”}”(hŒkcode should **never** unlock an hwspinlock which is already unlocked (there is no protection against this).”h]”(hŒ code should ”…””}”(hjsh²hh³Nh´NubhŒstrong”“”)”}”(hŒ **never**”h]”hŒnever”…””}”(hj}h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j{hjsubhŒV unlock an hwspinlock which is already unlocked (there is no protection against this).”…””}”(hjsh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mhjoubah}”(h]”h ]”h"]”h$]”h&]”uh1jmhjHh²hh³hÊh´NubjZ)”}”(hŒ2void hwspin_unlock_irq(struct hwspinlock *hwlock);”h]”hŒ2void hwspin_unlock_irq(struct hwspinlock *hwlock);”…””}”hj›sbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´MhjHh²hubhÝ)”}”(hŒŽUnlock a previously-locked hwspinlock and enable local interrupts. The caller should **never** unlock an hwspinlock which is already unlocked.”h]”(hŒUUnlock a previously-locked hwspinlock and enable local interrupts. The caller should ”…””}”(hj©h²hh³Nh´Nubj|)”}”(hŒ **never**”h]”hŒnever”…””}”(hj±h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j{hj©ubhŒ0 unlock an hwspinlock which is already unlocked.”…””}”(hj©h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MhjHh²hubhÝ)”}”(hŒ½Doing so is considered a bug (there is no protection against this). Upon a successful return from this function, preemption and local interrupts are enabled. This function will never sleep.”h]”hŒ½Doing so is considered a bug (there is no protection against this). Upon a successful return from this function, preemption and local interrupts are enabled. This function will never sleep.”…””}”(hjÉh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M hjHh²hubjZ)”}”(hŒOvoid hwspin_unlock_irqrestore(struct hwspinlock *hwlock, unsigned long *flags);”h]”hŒOvoid hwspin_unlock_irqrestore(struct hwspinlock *hwlock, unsigned long *flags);”…””}”hj×sbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´MhjHh²hubhÝ)”}”(hŒ&Unlock a previously-locked hwspinlock.”h]”hŒ&Unlock a previously-locked hwspinlock.”…””}”(hjåh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MhjHh²hubhÝ)”}”(hXNThe caller should **never** unlock an hwspinlock which is already unlocked. Doing so is considered a bug (there is no protection against this). Upon a successful return from this function, preemption is reenabled, and the state of the local interrupts is restored to the state saved at the given flags. This function will never sleep.”h]”(hŒThe caller should ”…””}”(hjóh²hh³Nh´Nubj|)”}”(hŒ **never**”h]”hŒnever”…””}”(hjûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j{hjóubhX3 unlock an hwspinlock which is already unlocked. Doing so is considered a bug (there is no protection against this). Upon a successful return from this function, preemption is reenabled, and the state of the local interrupts is restored to the state saved at the given flags. This function will never sleep.”…””}”(hjóh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´MhjHh²hubjZ)”}”(hŒ2void hwspin_unlock_raw(struct hwspinlock *hwlock);”h]”hŒ2void hwspin_unlock_raw(struct hwspinlock *hwlock);”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´MhjHh²hubhÝ)”}”(hŒ&Unlock a previously-locked hwspinlock.”h]”hŒ&Unlock a previously-locked hwspinlock.”…””}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M hjHh²hubhÝ)”}”(hŒ¯The caller should **never** unlock an hwspinlock which is already unlocked. Doing so is considered a bug (there is no protection against this). This function will never sleep.”h]”(hŒThe caller should ”…””}”(hj/h²hh³Nh´Nubj|)”}”(hŒ **never**”h]”hŒnever”…””}”(hj7h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j{hj/ubhŒ” unlock an hwspinlock which is already unlocked. Doing so is considered a bug (there is no protection against this). This function will never sleep.”…””}”(hj/h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M"hjHh²hubjZ)”}”(hŒ8void hwspin_unlock_in_atomic(struct hwspinlock *hwlock);”h]”hŒ8void hwspin_unlock_in_atomic(struct hwspinlock *hwlock);”…””}”hjOsbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´M(hjHh²hubhÝ)”}”(hŒ&Unlock a previously-locked hwspinlock.”h]”hŒ&Unlock a previously-locked hwspinlock.”…””}”(hj]h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M*hjHh²hubhÝ)”}”(hŒ¯The caller should **never** unlock an hwspinlock which is already unlocked. Doing so is considered a bug (there is no protection against this). This function will never sleep.”h]”(hŒThe caller should ”…””}”(hjkh²hh³Nh´Nubj|)”}”(hŒ **never**”h]”hŒnever”…””}”(hjsh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j{hjkubhŒ” unlock an hwspinlock which is already unlocked. Doing so is considered a bug (there is no protection against this). This function will never sleep.”…””}”(hjkh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M,hjHh²hubeh}”(h]”Œuser-api”ah ]”h"]”Œuser api”ah$]”h&]”uh1hµhh·h²hh³hÊh´K'ubh¶)”}”(hhh]”(h»)”}”(hŒ Typical usage”h]”hŒ Typical usage”…””}”(hj–h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj“h²hh³hÊh´M1ubjZ)”}”(hXR#include #include int hwspinlock_example(void) { struct hwspinlock *hwlock; int ret; /* * assign a specific hwspinlock id - this should be called early * by board init code. */ hwlock = hwspin_lock_request_specific(PREDEFINED_LOCK_ID); if (!hwlock) ... /* try to take it, but don't spin on it */ ret = hwspin_trylock(hwlock); if (!ret) { pr_info("lock is already taken\n"); return -EBUSY; } /* * we took the lock, do our thing now, but do NOT sleep */ /* release the lock */ hwspin_unlock(hwlock); /* free the lock */ ret = hwspin_lock_free(hwlock); if (ret) ... return ret; }”h]”hXR#include #include int hwspinlock_example(void) { struct hwspinlock *hwlock; int ret; /* * assign a specific hwspinlock id - this should be called early * by board init code. */ hwlock = hwspin_lock_request_specific(PREDEFINED_LOCK_ID); if (!hwlock) ... /* try to take it, but don't spin on it */ ret = hwspin_trylock(hwlock); if (!ret) { pr_info("lock is already taken\n"); return -EBUSY; } /* * we took the lock, do our thing now, but do NOT sleep */ /* release the lock */ hwspin_unlock(hwlock); /* free the lock */ ret = hwspin_lock_free(hwlock); if (ret) ... return ret; }”…””}”hj¤sbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´M5hj“h²hubeh}”(h]”Œ typical-usage”ah ]”h"]”Œ typical usage”ah$]”h&]”uh1hµhh·h²hh³hÊh´M1ubh¶)”}”(hhh]”(h»)”}”(hŒAPI for implementors”h]”hŒAPI for implementors”…””}”(hj½h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjºh²hh³hÊh´M]ubjZ)”}”(hŒ™int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev, const struct hwspinlock_ops *ops, int base_id, int num_locks);”h]”hŒ™int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev, const struct hwspinlock_ops *ops, int base_id, int num_locks);”…””}”hjËsbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´Mahjºh²hubhÝ)”}”(hŒáTo be called from the underlying platform-specific implementation, in order to register a new hwspinlock device (which is usually a bank of numerous locks). Should be called from a process context (this function might sleep).”h]”hŒáTo be called from the underlying platform-specific implementation, in order to register a new hwspinlock device (which is usually a bank of numerous locks). Should be called from a process context (this function might sleep).”…””}”(hjÙh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mdhjºh²hubhÝ)”}”(hŒ;Returns 0 on success, or appropriate error code on failure.”h]”hŒ;Returns 0 on success, or appropriate error code on failure.”…””}”(hjçh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mihjºh²hubjZ)”}”(hŒ;int hwspin_lock_unregister(struct hwspinlock_device *bank);”h]”hŒ;int hwspin_lock_unregister(struct hwspinlock_device *bank);”…””}”hjõsbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´Mmhjºh²hubhÝ)”}”(hŒ™To be called from the underlying vendor-specific implementation, in order to unregister an hwspinlock device (which is usually a bank of numerous locks).”h]”hŒ™To be called from the underlying vendor-specific implementation, in order to unregister an hwspinlock device (which is usually a bank of numerous locks).”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mohjºh²hubhÝ)”}”(hŒDShould be called from a process context (this function might sleep).”h]”hŒDShould be called from a process context (this function might sleep).”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Mshjºh²hubhÝ)”}”(hŒhReturns the address of hwspinlock on success, or NULL on error (e.g. if the hwspinlock is still in use).”h]”hŒhReturns the address of hwspinlock on success, or NULL on error (e.g. if the hwspinlock is still in use).”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´Muhjºh²hubeh}”(h]”Œapi-for-implementors”ah ]”h"]”Œapi for implementors”ah$]”h&]”uh1hµhh·h²hh³hÊh´M]ubh¶)”}”(hhh]”(h»)”}”(hŒImportant structs”h]”hŒImportant structs”…””}”(hj8h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj5h²hh³hÊh´MyubhÝ)”}”(hŒ¸struct hwspinlock_device is a device which usually contains a bank of hardware locks. It is registered by the underlying hwspinlock implementation using the hwspin_lock_register() API.”h]”hŒ¸struct hwspinlock_device is a device which usually contains a bank of hardware locks. It is registered by the underlying hwspinlock implementation using the hwspin_lock_register() API.”…””}”(hjFh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M{hj5h²hubjZ)”}”(hX/** * struct hwspinlock_device - a device which usually spans numerous hwspinlocks * @dev: underlying device, will be used to invoke runtime PM api * @ops: platform-specific hwspinlock handlers * @base_id: id index of the first lock in this device * @num_locks: number of locks in this device * @lock: dynamically allocated array of 'struct hwspinlock' */ struct hwspinlock_device { struct device *dev; const struct hwspinlock_ops *ops; int base_id; int num_locks; struct hwspinlock lock[0]; };”h]”hX/** * struct hwspinlock_device - a device which usually spans numerous hwspinlocks * @dev: underlying device, will be used to invoke runtime PM api * @ops: platform-specific hwspinlock handlers * @base_id: id index of the first lock in this device * @num_locks: number of locks in this device * @lock: dynamically allocated array of 'struct hwspinlock' */ struct hwspinlock_device { struct device *dev; const struct hwspinlock_ops *ops; int base_id; int num_locks; struct hwspinlock lock[0]; };”…””}”hjTsbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´Mhj5h²hubhÝ)”}”(hŒsstruct hwspinlock_device contains an array of hwspinlock structs, each of which represents a single hardware lock::”h]”hŒrstruct hwspinlock_device contains an array of hwspinlock structs, each of which represents a single hardware lock:”…””}”(hjbh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M‘hj5h²hubjZ)”}”(hX{/** * struct hwspinlock - this struct represents a single hwspinlock instance * @bank: the hwspinlock_device structure which owns this lock * @lock: initialized and used by hwspinlock core * @priv: private data, owned by the underlying platform-specific hwspinlock drv */ struct hwspinlock { struct hwspinlock_device *bank; spinlock_t lock; void *priv; };”h]”hX{/** * struct hwspinlock - this struct represents a single hwspinlock instance * @bank: the hwspinlock_device structure which owns this lock * @lock: initialized and used by hwspinlock core * @priv: private data, owned by the underlying platform-specific hwspinlock drv */ struct hwspinlock { struct hwspinlock_device *bank; spinlock_t lock; void *priv; };”…””}”hjpsbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´M”hj5h²hubhÝ)”}”(hŒ·When registering a bank of locks, the hwspinlock driver only needs to set the priv members of the locks. The rest of the members are set and initialized by the hwspinlock core itself.”h]”hŒ·When registering a bank of locks, the hwspinlock driver only needs to set the priv members of the locks. The rest of the members are set and initialized by the hwspinlock core itself.”…””}”(hj~h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M hj5h²hubeh}”(h]”Œimportant-structs”ah ]”h"]”Œimportant structs”ah$]”h&]”uh1hµhh·h²hh³hÊh´Myubh¶)”}”(hhh]”(h»)”}”(hŒImplementation callbacks”h]”hŒImplementation callbacks”…””}”(hj—h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj”h²hh³hÊh´M¥ubhÝ)”}”(hŒGThere are three possible callbacks defined in 'struct hwspinlock_ops'::”h]”hŒJThere are three possible callbacks defined in ‘struct hwspinlock_ops’:”…””}”(hj¥h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M§hj”h²hubjZ)”}”(hŒ¬struct hwspinlock_ops { int (*trylock)(struct hwspinlock *lock); void (*unlock)(struct hwspinlock *lock); void (*relax)(struct hwspinlock *lock); };”h]”hŒ¬struct hwspinlock_ops { int (*trylock)(struct hwspinlock *lock); void (*unlock)(struct hwspinlock *lock); void (*relax)(struct hwspinlock *lock); };”…””}”hj³sbah}”(h]”h ]”h"]”h$]”h&]”jijjuh1jYh³hÊh´M©hj”h²hubhÝ)”}”(hŒ&The first two callbacks are mandatory:”h]”hŒ&The first two callbacks are mandatory:”…””}”(hjÁh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M¯hj”h²hubhÝ)”}”(hŒ’The ->trylock() callback should make a single attempt to take the lock, and return 0 on failure and 1 on success. This callback may **not** sleep.”h]”(hŒ„The ->trylock() callback should make a single attempt to take the lock, and return 0 on failure and 1 on success. This callback may ”…””}”(hjÏh²hh³Nh´Nubj|)”}”(hŒ**not**”h]”hŒnot”…””}”(hj×h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j{hjÏubhŒ sleep.”…””}”(hjÏh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M±hj”h²hubhÝ)”}”(hŒ]The ->unlock() callback releases the lock. It always succeed, and it, too, may **not** sleep.”h]”(hŒOThe ->unlock() callback releases the lock. It always succeed, and it, too, may ”…””}”(hjïh²hh³Nh´Nubj|)”}”(hŒ**not**”h]”hŒnot”…””}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j{hjïubhŒ sleep.”…””}”(hjïh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M´hj”h²hubhÝ)”}”(hŒèThe ->relax() callback is optional. It is called by hwspinlock core while spinning on a lock, and can be used by the underlying implementation to force a delay between two successive invocations of ->trylock(). It may **not** sleep.”h]”(hŒÚThe ->relax() callback is optional. It is called by hwspinlock core while spinning on a lock, and can be used by the underlying implementation to force a delay between two successive invocations of ->trylock(). It may ”…””}”(hjh²hh³Nh´Nubj|)”}”(hŒ**not**”h]”hŒnot”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j{hjubhŒ sleep.”…””}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÜh³hÊh´M·hj”h²hubeh}”(h]”Œimplementation-callbacks”ah ]”h"]”Œimplementation callbacks”ah$]”h&]”uh1hµhh·h²hh³hÊh´M¥ubeh}”(h]”Œhardware-spinlock-framework”ah ]”h"]”Œhardware spinlock framework”ah$]”h&]”uh1hµhhh²hh³hÊh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÊuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hºNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jbŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÊŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(j<j9jEjBjjj·j´j2j/j‘jŽj4j1uŒ nametypes”}”(j<‰jE‰j‰j·‰j2‰j‘‰j4‰uh}”(j9h·jBhËjjHj´j“j/jºjŽj5j1j”uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.