Home
last modified time | relevance | path

Searched full:mutex (Results 1 – 25 of 4258) sorted by relevance

12345678910>>...171

/openbmc/linux/include/linux/
H A Dmutex.h41 * - only one task can hold the mutex at a time
42 * - only the owner can unlock the mutex
45 * - a mutex object must be initialized via the API
46 * - a mutex object must not be initialized via memset or copying
47 * - task may not exit with mutex held
54 * enabled. Furthermore, besides enforcing the above rules, the mutex
66 struct mutex { struct
86 extern void mutex_destroy(struct mutex *lock); argument
92 static inline void mutex_destroy(struct mutex *lock) {} in mutex_destroy()
97 * mutex_init - initialize the mutex
[all …]
H A Dww_mutex.h5 * Original mutex implementation started by Ingo Molnar:
20 #include <linux/mutex.h>
29 #define WW_MUTEX_BASE mutex
88 * ww_mutex_init - initialize the w/w mutex
89 * @lock: the mutex to be initialized
90 * @ww_class: the w/w class the mutex should belong to
92 * Initialize the w/w mutex to unlocked state and associate it with the given
93 * class. Static define macro for w/w mutex is not provided and this function
94 * is the only way to properly initialize the w/w mutex.
96 * It is not allowed to initialize an already locked mutex.
[all …]
/openbmc/linux/drivers/net/ethernet/netronome/nfp/nfpcore/
H A Dnfp_mutex.c69 * nfp_cpp_mutex_init() - Initialize a mutex location
73 * @key: Unique 32-bit value for this mutex
78 * This creates the initial mutex state, as locked by this
109 * nfp_cpp_mutex_alloc() - Create a mutex handle
128 struct nfp_cpp_mutex *mutex; in nfp_cpp_mutex_alloc() local
143 mutex = kzalloc(sizeof(*mutex), GFP_KERNEL); in nfp_cpp_mutex_alloc()
144 if (!mutex) in nfp_cpp_mutex_alloc()
147 mutex->cpp = cpp; in nfp_cpp_mutex_alloc()
148 mutex->target = target; in nfp_cpp_mutex_alloc()
149 mutex->address = address; in nfp_cpp_mutex_alloc()
[all …]
/openbmc/linux/drivers/acpi/acpica/
H A Dexmutex.c4 * Module Name: exmutex - ASL Mutex Acquire/Release functions
27 * PARAMETERS: obj_desc - The mutex to be unlinked
31 * DESCRIPTION: Remove a mutex from the "AcquiredMutex" list
37 struct acpi_thread_state *thread = obj_desc->mutex.owner_thread; in acpi_ex_unlink_mutex()
45 if (obj_desc->mutex.next) { in acpi_ex_unlink_mutex()
46 (obj_desc->mutex.next)->mutex.prev = obj_desc->mutex.prev; in acpi_ex_unlink_mutex()
49 if (obj_desc->mutex.prev) { in acpi_ex_unlink_mutex()
50 (obj_desc->mutex.prev)->mutex.next = obj_desc->mutex.next; in acpi_ex_unlink_mutex()
53 * Migrate the previous sync level associated with this mutex to in acpi_ex_unlink_mutex()
54 * the previous mutex on the list so that it may be preserved. in acpi_ex_unlink_mutex()
[all …]
H A Dutxfmutex.c4 * Module Name: utxfmutex - external AML mutex access functions
25 * PARAMETERS: handle - Mutex or prefix handle (optional)
26 * pathname - Mutex pathname (optional)
27 * ret_obj - Where the mutex object is returned
31 * DESCRIPTION: Get an AML mutex object. The mutex node is pointed to by
52 /* Get a the namespace node for the mutex */ in acpi_ut_get_mutex_object()
64 /* Ensure that we actually have a Mutex object */ in acpi_ut_get_mutex_object()
70 /* Get the low-level mutex object */ in acpi_ut_get_mutex_object()
85 * PARAMETERS: handle - Mutex or prefix handle (optional)
86 * pathname - Mutex pathname (optional)
[all …]
H A Dutmutex.c4 * Module Name: utmutex - local mutex support
27 * DESCRIPTION: Create the system mutex objects. This includes mutexes,
39 /* Create each of the predefined mutex objects */ in acpi_ut_mutex_initialize()
65 /* Mutex for _OSI support */ in acpi_ut_mutex_initialize()
90 * DESCRIPTION: Delete all of the system mutex objects. This includes mutexes,
101 /* Delete each predefined mutex object */ in acpi_ut_mutex_terminate()
125 * PARAMETERS: mutex_ID - ID of the mutex to be created
129 * DESCRIPTION: Create a mutex object.
139 if (!acpi_gbl_mutex_info[mutex_id].mutex) { in acpi_ut_create_mutex()
141 acpi_os_create_mutex(&acpi_gbl_mutex_info[mutex_id].mutex); in acpi_ut_create_mutex()
[all …]
/openbmc/qemu/util/
H A Dqemu-coroutine-lock.c24 * The lock-free mutex implementation is based on OSv
25 * (core/lfmutex.cc, include/lockfree/mutex.hh).
65 * mutex's queue. This avoids the thundering herd effect. in qemu_co_queue_wait_impl()
120 * because pop_waiter() can only be called while mutex->handoff is zero.
123 * In this case, qemu_co_mutex_lock will see mutex->handoff == 0 and
131 * In this case another iteration starts with mutex->handoff == 0;
142 static void coroutine_fn push_waiter(CoMutex *mutex, CoWaitRecord *w) in push_waiter() argument
145 QSLIST_INSERT_HEAD_ATOMIC(&mutex->from_push, w, next); in push_waiter()
148 static void move_waiters(CoMutex *mutex) in move_waiters() argument
151 QSLIST_MOVE_ATOMIC(&reversed, &mutex->from_push); in move_waiters()
[all …]
H A Dqemu-thread-common.h19 static inline void qemu_mutex_post_init(QemuMutex *mutex) in qemu_mutex_post_init() argument
22 mutex->file = NULL; in qemu_mutex_post_init()
23 mutex->line = 0; in qemu_mutex_post_init()
25 mutex->initialized = true; in qemu_mutex_post_init()
28 static inline void qemu_mutex_pre_lock(QemuMutex *mutex, in qemu_mutex_pre_lock() argument
31 trace_qemu_mutex_lock(mutex, file, line); in qemu_mutex_pre_lock()
34 static inline void qemu_mutex_post_lock(QemuMutex *mutex, in qemu_mutex_post_lock() argument
38 mutex->file = file; in qemu_mutex_post_lock()
39 mutex->line = line; in qemu_mutex_post_lock()
41 trace_qemu_mutex_locked(mutex, file, line); in qemu_mutex_post_lock()
[all …]
H A Dqemu-thread-win32.c2 * Win32 implementation for mutex/cond/thread functions
68 void qemu_mutex_init(QemuMutex *mutex) in qemu_mutex_init() argument
70 InitializeSRWLock(&mutex->lock); in qemu_mutex_init()
71 qemu_mutex_post_init(mutex); in qemu_mutex_init()
74 void qemu_mutex_destroy(QemuMutex *mutex) in qemu_mutex_destroy() argument
76 assert(mutex->initialized); in qemu_mutex_destroy()
77 mutex->initialized = false; in qemu_mutex_destroy()
78 InitializeSRWLock(&mutex->lock); in qemu_mutex_destroy()
81 void qemu_mutex_lock_impl(QemuMutex *mutex, const char *file, const int line) in qemu_mutex_lock_impl() argument
83 assert(mutex->initialized); in qemu_mutex_lock_impl()
[all …]
H A Dqemu-thread-posix.c2 * Wrappers around mutex/cond/thread functions
67 void qemu_mutex_init(QemuMutex *mutex) in qemu_mutex_init() argument
71 err = pthread_mutex_init(&mutex->lock, NULL); in qemu_mutex_init()
74 qemu_mutex_post_init(mutex); in qemu_mutex_init()
77 void qemu_mutex_destroy(QemuMutex *mutex) in qemu_mutex_destroy() argument
81 assert(mutex->initialized); in qemu_mutex_destroy()
82 mutex->initialized = false; in qemu_mutex_destroy()
83 err = pthread_mutex_destroy(&mutex->lock); in qemu_mutex_destroy()
88 void qemu_mutex_lock_impl(QemuMutex *mutex, const char *file, const int line) in qemu_mutex_lock_impl() argument
92 assert(mutex->initialized); in qemu_mutex_lock_impl()
[all …]
/openbmc/linux/Documentation/devicetree/bindings/soc/mediatek/
H A Dmediatek,mutex.yaml4 $id: http://devicetree.org/schemas/soc/mediatek/mediatek,mutex.yaml#
7 title: Mediatek mutex
14 Mediatek mutex, namely MUTEX, is used to send the triggers signals called
17 In some SoC, such as mt2701, MUTEX could be a hardware mutex which protects
19 MUTEX device node must be siblings to the central MMSYS_CONFIG node.
27 - mediatek,mt2701-disp-mutex
28 - mediatek,mt2712-disp-mutex
29 - mediatek,mt6795-disp-mutex
30 - mediatek,mt8167-disp-mutex
31 - mediatek,mt8173-disp-mutex
[all …]
/openbmc/linux/drivers/gpu/drm/amd/pm/
H A Damdgpu_dpm.c49 mutex_lock(&adev->pm.mutex); in amdgpu_dpm_get_sclk()
52 mutex_unlock(&adev->pm.mutex); in amdgpu_dpm_get_sclk()
65 mutex_lock(&adev->pm.mutex); in amdgpu_dpm_get_mclk()
68 mutex_unlock(&adev->pm.mutex); in amdgpu_dpm_get_mclk()
85 mutex_lock(&adev->pm.mutex); in amdgpu_dpm_set_powergating_by_smu()
107 mutex_unlock(&adev->pm.mutex); in amdgpu_dpm_set_powergating_by_smu()
117 mutex_lock(&adev->pm.mutex); in amdgpu_dpm_set_gfx_power_up_by_imu()
119 mutex_unlock(&adev->pm.mutex); in amdgpu_dpm_set_gfx_power_up_by_imu()
135 mutex_lock(&adev->pm.mutex); in amdgpu_dpm_baco_enter()
140 mutex_unlock(&adev->pm.mutex); in amdgpu_dpm_baco_enter()
[all …]
/openbmc/linux/drivers/soc/mediatek/
H A Dmtk-mutex.c13 #include <linux/soc/mediatek/mtk-mutex.h>
316 struct mtk_mutex mutex[MTK_MUTEX_MAX_HANDLES]; member
598 * So that MUTEX can not only send a STREAM_DONE event to GCE
722 if (!mtx->mutex[i].claimed) { in mtk_mutex_get()
723 mtx->mutex[i].claimed = true; in mtk_mutex_get()
724 return &mtx->mutex[i]; in mtk_mutex_get()
731 void mtk_mutex_put(struct mtk_mutex *mutex) in mtk_mutex_put() argument
733 struct mtk_mutex_ctx *mtx = container_of(mutex, struct mtk_mutex_ctx, in mtk_mutex_put()
734 mutex[mutex->id]); in mtk_mutex_put()
736 WARN_ON(&mtx->mutex[mutex->id] != mutex); in mtk_mutex_put()
[all …]
/openbmc/linux/Documentation/locking/
H A Dmutex-design.rst2 Generic Mutex Subsystem
26 Mutexes are represented by 'struct mutex', defined in include/linux/mutex.h
27 and implemented in kernel/locking/mutex.c. These locks use an atomic variable
37 When acquiring a mutex, there are three possible paths that can be
49 soon. The mutex spinners are queued up using MCS lock so that only
50 one spinner can compete for the mutex.
61 waiting to spin on mutex owner, only to go directly to slowpath upon
78 The mutex subsystem checks and enforces the following rules:
80 - Only one task can hold the mutex at a time.
81 - Only the owner can unlock the mutex.
[all …]
H A Drt-mutex-design.rst2 RT-mutex implementation design
12 Documentation/locking/rt-mutex.rst. Although this document does explain problems
27 to use a resource that a lower priority process has (a mutex for example),
85 mutex
88 the PI locks will be called a mutex.
103 a process being blocked on the mutex, it is fine to allocate
105 structure holds a pointer to the task, as well as the mutex that
107 place the task in the waiters rbtree of a mutex as well as the
108 pi_waiters rbtree of a mutex owner task (described below).
111 on a mutex. This is the same as waiter->task.
[all …]
/openbmc/linux/kernel/locking/
H A Dmutex.c3 * kernel/locking/mutex.c
19 * Also see Documentation/locking/mutex-design.rst.
21 #include <linux/mutex.h>
37 #include "mutex.h"
46 __mutex_init(struct mutex *lock, const char *name, struct lock_class_key *key) in __mutex_init()
77 * DO NOT USE (outside of mutex code).
79 static inline struct task_struct *__mutex_owner(struct mutex *lock) in __mutex_owner()
89 bool mutex_is_locked(struct mutex *lock) in mutex_is_locked()
103 static inline struct task_struct *__mutex_trylock_common(struct mutex *lock, bool handoff) in __mutex_trylock_common()
142 static inline bool __mutex_trylock_or_handoff(struct mutex *lock, bool handoff) in __mutex_trylock_or_handoff()
[all …]
H A Dmutex-debug.c13 #include <linux/mutex.h>
24 #include "mutex.h"
29 void debug_mutex_lock_common(struct mutex *lock, struct mutex_waiter *waiter) in debug_mutex_lock_common()
37 void debug_mutex_wake_waiter(struct mutex *lock, struct mutex_waiter *waiter) in debug_mutex_wake_waiter()
51 void debug_mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter, in debug_mutex_add_waiter()
60 void debug_mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter, in debug_mutex_remove_waiter()
72 void debug_mutex_unlock(struct mutex *lock) in debug_mutex_unlock()
80 void debug_mutex_init(struct mutex *lock, const char *name, in debug_mutex_init()
98 int __devm_mutex_init(struct device *dev, struct mutex *lock) in __devm_mutex_init()
105 * mutex_destroy - mark a mutex unusable
[all …]
/openbmc/qemu/include/qemu/
H A Dthread.h26 void qemu_mutex_init(QemuMutex *mutex);
27 void qemu_mutex_destroy(QemuMutex *mutex);
28 int TSA_NO_TSA qemu_mutex_trylock_impl(QemuMutex *mutex, const char *file,
30 void TSA_NO_TSA qemu_mutex_lock_impl(QemuMutex *mutex, const char *file,
32 void TSA_NO_TSA qemu_mutex_unlock_impl(QemuMutex *mutex, const char *file,
35 void qemu_rec_mutex_init(QemuRecMutex *mutex);
36 void qemu_rec_mutex_destroy(QemuRecMutex *mutex);
37 void qemu_rec_mutex_lock_impl(QemuRecMutex *mutex, const char *file, int line);
38 int qemu_rec_mutex_trylock_impl(QemuRecMutex *mutex, const char *file, int line);
39 void qemu_rec_mutex_unlock_impl(QemuRecMutex *mutex, const char *file, int line);
[all …]
/openbmc/linux/rust/kernel/sync/lock/
H A Dmutex.rs3 //! A kernel mutex.
5 //! This module allows Rust code to use the kernel's `struct mutex`.
9 /// Creates a [`Mutex`] initialiser with the given name and a newly-created lock class.
16 $crate::sync::Mutex::new(
23 /// Exposes the kernel's [`struct mutex`]. When multiple threads attempt to lock the same mutex,
24 /// only one at a time is allowed to progress, the others will block (sleep) until the mutex is
27 /// Since it may block, [`Mutex`] needs to be used with care in atomic contexts.
29 /// Instances of [`Mutex`] need a lock class and to be pinned. The recommended way to create such
35 /// contains an inner struct (`Inner`) that is protected by a mutex.
38 /// use kernel::{init::InPlaceInit, init::PinInit, new_mutex, pin_init, sync::Mutex};
[all …]
/openbmc/linux/Documentation/translations/zh_CN/locking/
H A Dmutex-design.rst4 :Original: Documentation/locking/mutex-design.rst
25 在Linux内核中,互斥锁(mutex)指的是一个特殊的加锁原语,它在共享内存系统上
36 互斥锁由“struct mutex”表示,在include/linux/mutex.h中定义,并在
37 kernel/locking/mutex.c中实现。这些锁使用一个原子变量(->owner)来跟踪
107 mutex_init(mutex);
111 void mutex_lock(struct mutex *lock);
112 void mutex_lock_nested(struct mutex *lock, unsigned int subclass);
113 int mutex_trylock(struct mutex *lock);
117 int mutex_lock_interruptible_nested(struct mutex *lock,
119 int mutex_lock_interruptible(struct mutex *lock);
[all …]
/openbmc/linux/include/linux/soc/mediatek/
H A Dmtk-mutex.h71 int mtk_mutex_prepare(struct mtk_mutex *mutex);
72 void mtk_mutex_add_comp(struct mtk_mutex *mutex,
74 void mtk_mutex_enable(struct mtk_mutex *mutex);
75 int mtk_mutex_enable_by_cmdq(struct mtk_mutex *mutex,
77 void mtk_mutex_disable(struct mtk_mutex *mutex);
78 void mtk_mutex_remove_comp(struct mtk_mutex *mutex,
80 void mtk_mutex_unprepare(struct mtk_mutex *mutex);
81 void mtk_mutex_put(struct mtk_mutex *mutex);
82 void mtk_mutex_acquire(struct mtk_mutex *mutex);
83 void mtk_mutex_release(struct mtk_mutex *mutex);
[all …]
/openbmc/linux/drivers/net/wireless/realtek/rtw89/
H A Dmac80211.c62 mutex_lock(&rtwdev->mutex); in rtw89_ops_start()
64 mutex_unlock(&rtwdev->mutex); in rtw89_ops_start()
73 mutex_lock(&rtwdev->mutex); in rtw89_ops_stop()
75 mutex_unlock(&rtwdev->mutex); in rtw89_ops_stop()
85 mutex_lock(&rtwdev->mutex); in rtw89_ops_config()
103 mutex_unlock(&rtwdev->mutex); in rtw89_ops_config()
118 mutex_lock(&rtwdev->mutex); in rtw89_ops_add_interface()
168 mutex_unlock(&rtwdev->mutex); in rtw89_ops_add_interface()
185 mutex_lock(&rtwdev->mutex); in rtw89_ops_remove_interface()
194 mutex_unlock(&rtwdev->mutex); in rtw89_ops_remove_interface()
[all …]
/openbmc/linux/Documentation/devicetree/bindings/hwlock/
H A Dqcom-hwspinlock.yaml7 title: Qualcomm Hardware Mutex Block
20 - qcom,sfpb-mutex
21 - qcom,tcsr-mutex
24 - qcom,apq8084-tcsr-mutex
25 - qcom,ipq6018-tcsr-mutex
26 - qcom,msm8226-tcsr-mutex
27 - qcom,msm8994-tcsr-mutex
28 - const: qcom,tcsr-mutex
31 - qcom,msm8974-tcsr-mutex
32 - const: qcom,tcsr-mutex
[all …]
/openbmc/linux/drivers/net/wireless/realtek/rtw88/
H A Dmac80211.c58 mutex_lock(&rtwdev->mutex); in rtw_ops_start()
60 mutex_unlock(&rtwdev->mutex); in rtw_ops_start()
69 mutex_lock(&rtwdev->mutex); in rtw_ops_stop()
71 mutex_unlock(&rtwdev->mutex); in rtw_ops_stop()
82 mutex_lock(&rtwdev->mutex); in rtw_ops_config()
104 mutex_unlock(&rtwdev->mutex); in rtw_ops_config()
168 mutex_lock(&rtwdev->mutex); in rtw_ops_add_interface()
172 mutex_unlock(&rtwdev->mutex); in rtw_ops_add_interface()
201 mutex_unlock(&rtwdev->mutex); in rtw_ops_add_interface()
215 mutex_unlock(&rtwdev->mutex); in rtw_ops_add_interface()
[all …]
/openbmc/qemu/docs/spin/
H A Dtcg-exclusive.promela27 // If the mutex is used, it's also cheap (300 MB / 4 seconds) for 3 CPUs
70 mutex_t mutex;
80 :: pending_cpus -> COND_WAIT(exclusive_resume, mutex); \
85 MUTEX_LOCK(mutex); \
102 :: pending_cpus > 1 -> COND_WAIT(exclusive_cond, mutex); \
105 MUTEX_UNLOCK(mutex);
108 MUTEX_LOCK(mutex); \
111 MUTEX_UNLOCK(mutex);
116 MUTEX_LOCK(mutex); \
119 MUTEX_UNLOCK(mutex);
[all …]

12345678910>>...171