| /linux/drivers/net/ethernet/netronome/nfp/nfpcore/ |
| H A D | nfp_mutex.c | 69 * 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_obj(*mutex); 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 …]
|
| H A D | nfp_resource.c | 29 * @mutex: NFP CPP Lock 30 * @mutex.owner: NFP CPP Lock, interface owner 31 * @mutex.key: NFP CPP Lock, posix_crc32(name, 8) 45 } mutex; member 66 struct nfp_cpp_mutex *mutex; member 92 if (entry.mutex.key != key) in nfp_cpp_resource_find() 96 res->mutex = in nfp_cpp_resource_find() 124 err = nfp_cpp_mutex_trylock(res->mutex); in nfp_resource_try_acquire() 133 nfp_cpp_mutex_free(res->mutex); in nfp_resource_try_acquire() 215 nfp_cpp_mutex_unlock(res->mutex); in nfp_resource_release() [all …]
|
| /linux/Documentation/locking/ |
| H A D | mutex-design.rst | 2 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 D | rt-mutex-design.rst | 2 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 …]
|
| H A D | futex-requeue-pi.rst | 8 boosting logic [see rt-mutex-design.rst] For the purposes of 21 rest to the natural wakeup inherent in unlocking the mutex 26 /* caller must lock mutex */ 27 pthread_cond_wait(cond, mutex) 30 unlock(mutex); 37 lock(mutex); 44 futex_requeue(cond->data.__futex, cond->mutex); 47 Once pthread_cond_broadcast() requeues the tasks, the cond->mutex 49 mutex only after it has returned to user space. This will leave the 60 /* caller must lock mutex */ [all …]
|
| /linux/drivers/acpi/acpica/ |
| H A D | utxfmutex.c | 4 * 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 D | utmutex.c | 4 * 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 …]
|
| /linux/Documentation/translations/zh_CN/locking/ |
| H A D | mutex-design.rst | 4 :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 …]
|
| /linux/include/linux/soc/mediatek/ |
| H A D | mtk-mutex.h | 71 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 …]
|
| /linux/Documentation/devicetree/bindings/hwlock/ |
| H A D | qcom-hwspinlock.yaml | 7 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 …]
|
| /linux/drivers/net/wireless/realtek/rtw88/ |
| H A D | mac80211.c | 58 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() 178 mutex_unlock(&rtwdev->mutex); in rtw_ops_add_interface() 207 mutex_unlock(&rtwdev->mutex); in rtw_ops_add_interface() [all …]
|
| /linux/drivers/vhost/ |
| H A D | test.c | 13 #include <linux/mutex.h> 57 mutex_lock(&vq->mutex); in handle_vq() 60 mutex_unlock(&vq->mutex); in handle_vq() 99 mutex_unlock(&vq->mutex); in handle_vq() 141 mutex_lock(&vq->mutex); in vhost_test_stop_vq() 144 mutex_unlock(&vq->mutex); in vhost_test_stop_vq() 181 mutex_lock(&n->dev.mutex); in vhost_test_run() 196 mutex_lock(&vq->mutex); in vhost_test_run() 205 mutex_unlock(&vq->mutex); in vhost_test_run() 215 mutex_unlock(&n->dev.mutex); in vhost_test_run() [all …]
|
| /linux/drivers/media/dvb-core/ |
| H A D | dmxdev.c | 125 if (mutex_lock_interruptible(&dmxdev->mutex)) in dvb_dvr_open() 129 mutex_unlock(&dmxdev->mutex); in dvb_dvr_open() 153 mutex_unlock(&dmxdev->mutex); in dvb_dvr_open() 163 mutex_unlock(&dmxdev->mutex); in dvb_dvr_open() 168 mutex_unlock(&dmxdev->mutex); in dvb_dvr_open() 176 &dmxdev->mutex, in dvb_dvr_open() 185 mutex_unlock(&dmxdev->mutex); in dvb_dvr_open() 192 mutex_unlock(&dmxdev->mutex); in dvb_dvr_open() 199 mutex_unlock(&dmxdev->mutex); in dvb_dvr_open() 208 mutex_lock(&dmxdev->mutex); in dvb_dvr_release() [all …]
|
| /linux/tools/perf/util/ |
| H A D | mutex.h | 24 /* Documents if a shared field or global variable needs to be protected by a mutex. */ 29 * a mutex when dereferencing the pointer. 61 /* Documents a function that expects a mutex to be held prior to entry. */ 88 * A wrapper around the mutex implementation that allows perf to error check 91 struct LOCKABLE mutex { struct 101 void mutex_init(struct mutex *mtx); 106 void mutex_init_pshared(struct mutex *mtx); 107 /* Initializes a mutex that may be recursively held on the same thread. */ 108 void mutex_init_recursive(struct mutex *mtx); 109 void mutex_destroy(struct mutex *mtx); [all …]
|
| H A D | mutex.c | 2 #include "mutex.h" 20 static void __mutex_init(struct mutex *mtx, bool pshared, bool recursive) in __mutex_init() 38 void mutex_init(struct mutex *mtx) in mutex_init() 43 void mutex_init_pshared(struct mutex *mtx) in mutex_init_pshared() 48 void mutex_init_recursive(struct mutex *mtx) in mutex_init_recursive() 53 void mutex_destroy(struct mutex *mtx) in mutex_destroy() 58 void mutex_lock(struct mutex *mtx) in mutex_lock() 64 void mutex_unlock(struct mutex *mtx) in mutex_unlock() 70 bool mutex_trylock(struct mutex *mtx) in mutex_trylock() 112 void cond_wait(struct cond *cnd, struct mutex *mtx) in cond_wait()
|
| H A D | sharded_mutex.h | 5 #include "mutex.h" 9 * In a situation where a lock is needed per object, having a mutex can be 11 * constantly hashed, a sharded mutex is an alternative global pool of mutexes 12 * where the mutex is looked up from a hash value. This can lead to collisions 18 struct mutex mutexes[]; 24 static inline struct mutex *sharded_mutex__get_mutex(struct sharded_mutex *sm, size_t hash) in sharded_mutex__get_mutex()
|
| /linux/drivers/cpufreq/ |
| H A D | cpufreq_userspace.c | 15 #include <linux/mutex.h> 21 struct mutex mutex; member 38 mutex_lock(&userspace->mutex); in cpufreq_set() 46 mutex_unlock(&userspace->mutex); in cpufreq_set() 65 mutex_init(&userspace->mutex); in cpufreq_userspace_policy_init() 88 mutex_lock(&userspace->mutex); in cpufreq_userspace_policy_start() 91 mutex_unlock(&userspace->mutex); in cpufreq_userspace_policy_start() 101 mutex_lock(&userspace->mutex); in cpufreq_userspace_policy_stop() 104 mutex_unlock(&userspace->mutex); in cpufreq_userspace_policy_stop() 111 mutex_lock(&userspace->mutex); in cpufreq_userspace_policy_limits() [all …]
|
| /linux/drivers/iio/imu/bmi323/ |
| H A D | bmi323_core.c | 16 #include <linux/mutex.h> 171 struct mutex mutex; member 352 guard(mutex)(&data->mutex); in bmi323_set_mode() 429 guard(mutex)(&data->mutex); in bmi323_get_error_status() 474 guard(mutex)(&data->mutex); in bmi323_step_wtrmrk_en() 543 guard(mutex)(&data->mutex); in bmi323_motion_event_en() 577 guard(mutex)(&data->mutex); in bmi323_tap_event_en() 656 scoped_guard(mutex, &data->mutex) { in in_accel_gesture_tap_wait_dur_show() 687 guard(mutex)(&data->mutex); in in_accel_gesture_tap_wait_dur_store() 712 scoped_guard(mutex, &data->mutex) { in in_accel_gesture_tap_wait_timeout_show() [all …]
|
| /linux/drivers/media/cec/i2c/ |
| H A D | ch7322.c | 21 #include <linux/mutex.h> 154 struct mutex mutex; /* device access mutex */ member 172 WARN_ON(!mutex_is_locked(&ch7322->mutex)); in ch7322_send_message() 214 WARN_ON(!mutex_is_locked(&ch7322->mutex)); in ch7322_receive_message() 243 mutex_lock(&ch7322->mutex); in ch7322_tx_done() 246 mutex_unlock(&ch7322->mutex); in ch7322_tx_done() 275 mutex_lock(&ch7322->mutex); in ch7322_rx_done() 277 mutex_unlock(&ch7322->mutex); in ch7322_rx_done() 295 mutex_lock(&ch7322->mutex); in ch7322_phys_addr() 298 mutex_unlock(&ch7322->mutex); in ch7322_phys_addr() [all …]
|
| /linux/net/ceph/ |
| H A D | auth.c | 66 mutex_init(&ac->mutex); in ceph_auth_init() 94 mutex_lock(&ac->mutex); in ceph_auth_reset() 99 mutex_unlock(&ac->mutex); in ceph_auth_reset() 128 mutex_lock(&ac->mutex); in ceph_auth_build_hello() 156 mutex_unlock(&ac->mutex); in ceph_auth_build_hello() 213 mutex_lock(&ac->mutex); in ceph_handle_auth_reply() 277 mutex_unlock(&ac->mutex); in ceph_handle_auth_reply() 291 mutex_lock(&ac->mutex); in ceph_build_auth() 294 mutex_unlock(&ac->mutex); in ceph_build_auth() 302 mutex_lock(&ac->mutex); in ceph_auth_is_authenticated() [all …]
|
| /linux/sound/aoa/codecs/ |
| H A D | onyx.c | 59 /* mutex serializes concurrent access to the device 62 struct mutex mutex; 126 guard(mutex)(&onyx->mutex); in onyx_snd_vol_get() 149 guard(mutex)(&onyx->mutex); in onyx_snd_vol_put() 198 guard(mutex)(&onyx->mutex); in onyx_snd_inputgain_get() 216 guard(mutex)( in onyx_snd_inputgain_put() 61 struct mutex mutex; global() member [all...] |
| /linux/drivers/mtd/lpddr/ |
| H A D | lpddr_cmds.c | 87 mutex_init(&chip->mutex); in lpddr_cmdset() 151 mutex_unlock(&chip->mutex); in wait_for_ready() 166 mutex_lock(&chip->mutex); in wait_for_ready() 173 mutex_unlock(&chip->mutex); in wait_for_ready() 176 mutex_lock(&chip->mutex); in wait_for_ready() 237 ret = mutex_trylock(&contender->mutex); in get_chip() 241 mutex_unlock(&chip->mutex); in get_chip() 243 mutex_lock(&chip->mutex); in get_chip() 246 mutex_unlock(&contender->mutex); in get_chip() 250 mutex_unlock(&contender->mutex); in get_chip() [all …]
|
| /linux/drivers/misc/uacce/ |
| H A D | uacce.c | 83 * gets called with mmap_lock held, by taking uacce->mutex instead of in uacce_fops_unl_ioctl() 84 * q->mutex. Doing this in uacce_fops_mmap() is not possible because in uacce_fops_unl_ioctl() 86 * mmap_lock, while holding uacce->mutex. in uacce_fops_unl_ioctl() 88 mutex_lock(&uacce->mutex); in uacce_fops_unl_ioctl() 106 mutex_unlock(&uacce->mutex); in uacce_fops_unl_ioctl() 165 mutex_lock(&uacce->mutex); in uacce_fops_open() 188 mutex_init(&q->mutex); in uacce_fops_open() 190 mutex_unlock(&uacce->mutex); in uacce_fops_open() 198 mutex_unlock(&uacce->mutex); in uacce_fops_open() 207 mutex_lock(&uacce->mutex); in uacce_fops_release() [all …]
|
| /linux/drivers/gpu/drm/vkms/ |
| H A D | vkms_configfs.c | 4 #include <linux/mutex.h> 36 struct mutex lock; 144 scoped_guard(mutex, &crtc->dev->lock) in crtc_writeback_show() 161 scoped_guard(mutex, &crtc->dev->lock) { in crtc_writeback_store() 181 struct mutex *lock; in crtc_release() 186 scoped_guard(mutex, lock) { in crtc_release() 211 scoped_guard(mutex, &dev->lock) { in make_crtc_group() 256 scoped_guard(mutex, &plane->dev->lock) { in plane_possible_crtcs_allow_link() 275 scoped_guard(mutex, &plane->dev->lock) in plane_possible_crtcs_drop_link() 296 scoped_guard(mutex, &plane->dev->lock) in plane_type_show() [all …]
|
| /linux/tools/testing/selftests/drivers/ntsync/ |
| H A D | ntsync.c | 43 static int read_mutex_state(int mutex, __u32 *count, __u32 *owner) in read_mutex_state() argument 49 ret = ioctl(mutex, NTSYNC_IOC_MUTEX_READ, &args); in read_mutex_state() 55 #define check_mutex_state(mutex, count, owner) \ argument 58 int ret = read_mutex_state((mutex), &__count, &__owner); \ 64 static int unlock_mutex(int mutex, __u32 owner, __u32 *count) in unlock_mutex() argument 71 ret = ioctl(mutex, NTSYNC_IOC_MUTEX_UNLOCK, &args); in unlock_mutex() 230 int fd, ret, mutex; in TEST() local 239 mutex = ioctl(fd, NTSYNC_IOC_CREATE_MUTEX, &mutex_args); in TEST() 240 EXPECT_EQ(-1, mutex); in TEST() 245 mutex = ioctl(fd, NTSYNC_IOC_CREATE_MUTEX, &mutex_args); in TEST() [all …]
|