| /linux/tools/perf/util/ |
| H A D | mutex.c | 20 static void __mutex_init(struct mutex *mtx, bool pshared, bool recursive) in __mutex_init() argument 34 CHECK_ERR(pthread_mutex_init(&mtx->lock, &attr)); in __mutex_init() 38 void mutex_init(struct mutex *mtx) in mutex_init() argument 40 __mutex_init(mtx, /*pshared=*/false, /*recursive=*/false); in mutex_init() 43 void mutex_init_pshared(struct mutex *mtx) in mutex_init_pshared() argument 45 __mutex_init(mtx, /*pshared=*/true, /*recursive=*/false); in mutex_init_pshared() 48 void mutex_init_recursive(struct mutex *mtx) in mutex_init_recursive() argument 50 __mutex_init(mtx, /*pshared=*/false, /*recursive=*/true); in mutex_init_recursive() 53 void mutex_destroy(struct mutex *mtx) in mutex_destroy() argument 55 CHECK_ERR(pthread_mutex_destroy(&mtx->lock)); in mutex_destroy() [all …]
|
| H A D | mutex.h | 101 void mutex_init(struct mutex *mtx); 106 void mutex_init_pshared(struct mutex *mtx); 108 void mutex_init_recursive(struct mutex *mtx); 109 void mutex_destroy(struct mutex *mtx); 111 void mutex_lock(struct mutex *mtx) EXCLUSIVE_LOCK_FUNCTION(*mtx); 112 void mutex_unlock(struct mutex *mtx) UNLOCK_FUNCTION(*mtx); 114 bool mutex_trylock(struct mutex *mtx) EXCLUSIVE_TRYLOCK_FUNCTION(true, *mtx); 125 void cond_wait(struct cond *cnd, struct mutex *mtx) EXCLUSIVE_LOCKS_REQUIRED(mtx);
|
| H A D | rwsem.c | 12 mutex_init(&sem->mtx); in init_rwsem() 22 mutex_destroy(&sem->mtx); in exit_rwsem() 33 mutex_lock(&sem->mtx); in down_read() 44 mutex_unlock(&sem->mtx); in up_read() 55 mutex_lock(&sem->mtx); in down_write() 66 mutex_unlock(&sem->mtx); in up_write()
|
| /linux/drivers/soc/mediatek/ |
| H A D | mtk-mutex.c | 850 struct mtk_mutex_ctx *mtx = dev_get_drvdata(dev); in mtk_mutex_get() local 854 if (!mtx->mutex[i].claimed) { in mtk_mutex_get() 855 mtx->mutex[i].claimed = true; in mtk_mutex_get() 856 return &mtx->mutex[i]; in mtk_mutex_get() 865 struct mtk_mutex_ctx *mtx = container_of(mutex, struct mtk_mutex_ctx, in mtk_mutex_put() local 868 WARN_ON(&mtx->mutex[mutex->id] != mutex); in mtk_mutex_put() 876 struct mtk_mutex_ctx *mtx = container_of(mutex, struct mtk_mutex_ctx, in mtk_mutex_prepare() local 878 return clk_prepare_enable(mtx->clk); in mtk_mutex_prepare() 884 struct mtk_mutex_ctx *mtx = container_of(mutex, struct mtk_mutex_ctx, in mtk_mutex_unprepare() local 886 clk_disable_unprepare(mtx->clk); in mtk_mutex_unprepare() [all …]
|
| /linux/drivers/nfc/ |
| H A D | virtual_ncidev.c | 26 struct mutex mtx; member 44 mutex_lock(&vdev->mtx); in virtual_nci_close() 48 mutex_unlock(&vdev->mtx); in virtual_nci_close() 57 mutex_lock(&vdev->mtx); in virtual_nci_send() 59 mutex_unlock(&vdev->mtx); in virtual_nci_send() 65 mutex_unlock(&vdev->mtx); in virtual_nci_send() 69 mutex_unlock(&vdev->mtx); in virtual_nci_send() 88 mutex_lock(&vdev->mtx); in virtual_ncidev_read() 90 mutex_unlock(&vdev->mtx); in virtual_ncidev_read() 93 mutex_lock(&vdev->mtx); in virtual_ncidev_read() [all …]
|
| /linux/rust/pin-init/examples/ |
| H A D | mutex.rs | 110 mtx: self, in lock() 127 mtx: &'a CMutex<T>, field 134 let sguard = self.mtx.spin_lock.acquire(); in drop() 135 self.mtx.locked.set(false); in drop() 136 if let Some(list_field) = self.mtx.wait_list.next() { in drop() 152 unsafe { &*self.mtx.data.get() } in deref() 159 unsafe { &mut *self.mtx.data.get() } in deref_mut() 196 let mtx: Pin<Arc<CMutex<usize>>> = Arc::pin_init(CMutex::new(0)).unwrap(); in main() localVariable 201 let mtx = mtx.clone(); in main() localVariable 207 *mtx.lock() += 1; in main() [all …]
|
| H A D | pthread_mutex.rs | 112 PThreadMutexGuard { mtx: self } in lock() 117 mtx: &'a PThreadMutex<T>, field 123 unsafe { libc::pthread_mutex_unlock(self.mtx.raw.get()) }; in drop() 131 unsafe { &*self.mtx.data.get() } in deref() 137 unsafe { &mut *self.mtx.data.get() } in deref_mut() 155 let mtx: Pin<Arc<PThreadMutex<usize>>> = Arc::try_pin_init(PThreadMutex::new(0)).unwrap(); in main() localVariable 160 let mtx = mtx.clone(); in main() localVariable 166 *mtx.lock() += 1; in main() 171 *mtx in main() [all...] |
| H A D | static_init.rs | 90 let mtx: Pin<Arc<CMutex<usize>>> = Arc::pin_init(CMutex::new(0)).unwrap(); in main() localVariable 95 let mtx = mtx.clone(); in main() localVariable 103 *mtx.lock() += 1; in main() 111 *mtx.lock() += 1; in main() 121 println!("{:?}, {:?}", &*mtx.lock(), &*COUNT.lock()); in main() 122 assert_eq!(*mtx.lock(), workload * thread_count * 2); in main()
|
| /linux/kernel/locking/ |
| H A D | test-ww_mutex.c | 43 struct test_mutex *mtx = container_of(work, typeof(*mtx), work); in test_mutex_work() local 45 complete(&mtx->ready); in test_mutex_work() 46 wait_for_completion(&mtx->go); in test_mutex_work() 48 if (mtx->flags & TEST_MTX_TRY) { in test_mutex_work() 49 while (!ww_mutex_trylock(&mtx->mutex, NULL)) in test_mutex_work() 52 ww_mutex_lock(&mtx->mutex, NULL); in test_mutex_work() 54 complete(&mtx->done); in test_mutex_work() 55 ww_mutex_unlock(&mtx->mutex); in test_mutex_work() 61 struct test_mutex mtx; in __test_mutex() local 65 ww_mutex_init(&mtx.mutex, class); in __test_mutex() [all …]
|
| /linux/sound/aoa/codecs/ |
| H A D | tas.c | 97 struct mutex mtx; member 238 guard(mutex)(&tas->mtx); in tas_snd_vol_get() 256 guard(mutex)(&tas->mtx); in tas_snd_vol_put() 284 guard(mutex)(&tas->mtx); in tas_snd_mute_get() 295 guard(mutex)(&tas->mtx); in tas_snd_mute_put() 332 guard(mutex)(&tas->mtx); in tas_snd_mixer_get() 345 guard(mutex)(&tas->mtx); in tas_snd_mixer_put() 387 guard(mutex)(&tas->mtx); in tas_snd_drc_range_get() 401 guard(mutex)(&tas->mtx); in tas_snd_drc_range_put() 427 guard(mutex)(&tas->mtx); in tas_snd_drc_switch_get() [all …]
|
| /linux/drivers/net/ethernet/atheros/alx/ |
| H A D | ethtool.c | 166 mutex_lock(&alx->mtx); in alx_get_link_ksettings() 169 mutex_unlock(&alx->mtx); in alx_get_link_ksettings() 205 mutex_lock(&alx->mtx); in alx_set_link_ksettings() 207 mutex_unlock(&alx->mtx); in alx_set_link_ksettings() 218 mutex_lock(&alx->mtx); in alx_get_pauseparam() 223 mutex_unlock(&alx->mtx); in alx_get_pauseparam() 243 mutex_lock(&alx->mtx); in alx_set_pauseparam() 257 mutex_unlock(&alx->mtx); in alx_set_pauseparam() 267 mutex_unlock(&alx->mtx); in alx_set_pauseparam()
|
| H A D | main.c | 1093 mutex_init(&alx->mtx); in alx_init_sw() 1125 lockdep_assert_held(&alx->mtx); in alx_halt() 1152 lockdep_assert_held(&alx->mtx); in alx_activate() 1168 lockdep_assert_held(&alx->mtx); in alx_reinit() 1184 mutex_lock(&alx->mtx); in alx_change_mtu() 1186 mutex_unlock(&alx->mtx); in alx_change_mtu() 1259 lockdep_assert_held(&alx->mtx); in __alx_stop() 1296 lockdep_assert_held(&alx->mtx); in alx_check_link() 1355 mutex_lock(&alx->mtx); in alx_open() 1357 mutex_unlock(&alx->mtx); in alx_open() [all …]
|
| /linux/drivers/staging/vme_user/ |
| H A D | vme.c | 274 mutex_lock(&slave_image->mtx); in vme_slave_request() 279 mutex_unlock(&slave_image->mtx); in vme_slave_request() 283 mutex_unlock(&slave_image->mtx); in vme_slave_request() 301 mutex_lock(&slave_image->mtx); in vme_slave_request() 303 mutex_unlock(&slave_image->mtx); in vme_slave_request() 421 mutex_lock(&slave_image->mtx); in vme_slave_free() 426 mutex_unlock(&slave_image->mtx); in vme_slave_free() 842 mutex_lock(&dma_ctrlr->mtx); in vme_dma_request() 846 mutex_unlock(&dma_ctrlr->mtx); in vme_dma_request() 850 mutex_unlock(&dma_ctrlr->mtx); in vme_dma_request() [all …]
|
| H A D | vme_fake.c | 206 mutex_lock(&image->mtx); in fake_slave_set() 215 mutex_unlock(&image->mtx); in fake_slave_set() 234 mutex_lock(&image->mtx); in fake_slave_get() 243 mutex_unlock(&image->mtx); in fake_slave_get() 858 mutex_lock(&lm->mtx); in fake_lm_set() 863 mutex_unlock(&lm->mtx); in fake_lm_set() 876 mutex_unlock(&lm->mtx); in fake_lm_set() 885 mutex_unlock(&lm->mtx); in fake_lm_set() 901 mutex_lock(&lm->mtx); in fake_lm_get() 907 mutex_unlock(&lm->mtx); in fake_lm_get() [all …]
|
| H A D | vme_tsi148.c | 1797 mutex_lock(&ctrlr->mtx); in tsi148_dma_list_exec() 1808 mutex_unlock(&ctrlr->mtx); in tsi148_dma_list_exec() 1818 mutex_unlock(&ctrlr->mtx); in tsi148_dma_list_exec() 1861 mutex_lock(&ctrlr->mtx); in tsi148_dma_list_exec() 1863 mutex_unlock(&ctrlr->mtx); in tsi148_dma_list_exec() 1912 mutex_lock(&lm->mtx); in tsi148_lm_set() 1917 mutex_unlock(&lm->mtx); in tsi148_lm_set() 1937 mutex_unlock(&lm->mtx); in tsi148_lm_set() 1957 mutex_unlock(&lm->mtx); in tsi148_lm_set() 1973 mutex_lock(&lm->mtx); in tsi148_lm_get() [all …]
|
| /linux/drivers/net/ethernet/marvell/prestera/ |
| H A D | prestera_counter.c | 16 struct mutex mtx; /* protect block_list */ member 32 struct mutex mtx; /* protect stats and counter_idr */ member 52 mutex_lock(&counter->mtx); in prestera_counter_lock() 57 mutex_unlock(&counter->mtx); in prestera_counter_unlock() 62 mutex_lock(&block->mtx); in prestera_counter_block_lock() 67 mutex_unlock(&block->mtx); in prestera_counter_block_unlock() 175 mutex_init(&block->mtx); in prestera_counter_block_get() 187 mutex_destroy(&block->mtx); in prestera_counter_block_get() 220 mutex_destroy(&block->mtx); in prestera_counter_block_put() 449 mutex_init(&counter->mtx); in prestera_counter_init() [all …]
|
| /linux/fs/ |
| H A D | eventpoll.c | 186 struct mutex mtx; member 699 return rcu_dereference_check(epi->ws, lockdep_is_held(&epi->ep->mtx)); in ep_wakeup_source() 819 mutex_destroy(&ep->mtx); in ep_free() 908 mutex_lock(&ep->mtx); in ep_clear_and_put() 935 mutex_unlock(&ep->mtx); in ep_clear_and_put() 990 mutex_lock_nested(&ep->mtx, depth); in __ep_eventpoll_poll() 1007 mutex_unlock(&ep->mtx); in __ep_eventpoll_poll() 1077 mutex_lock(&ep->mtx); in ep_show_fdinfo() 1091 mutex_unlock(&ep->mtx); in ep_show_fdinfo() 1135 mutex_lock(&ep->mtx); in eventpoll_release_file() [all …]
|
| /linux/drivers/usb/misc/ |
| H A D | adutux.c | 71 struct mutex mtx; member 356 if (mutex_lock_interruptible(&dev->mtx)) in adu_read() 498 mutex_unlock(&dev->mtx); in adu_read() 516 retval = mutex_lock_interruptible(&dev->mtx); in adu_write() 541 mutex_unlock(&dev->mtx); in adu_write() 556 retval = mutex_lock_interruptible(&dev->mtx); in adu_write() 610 mutex_unlock(&dev->mtx); in adu_write() 614 mutex_unlock(&dev->mtx); in adu_write() 664 mutex_init(&dev->mtx); in adu_probe() 773 mutex_lock(&dev->mtx); /* not interruptible */ in adu_disconnect() [all …]
|
| /linux/net/rfkill/ |
| H A D | core.c | 79 struct mutex mtx; member 286 mutex_lock(&data->mtx); in rfkill_send_events() 288 mutex_unlock(&data->mtx); in rfkill_send_events() 1175 mutex_init(&data->mtx); in rfkill_fop_open() 1190 mutex_lock(&data->mtx); in rfkill_fop_open() 1192 mutex_unlock(&data->mtx); in rfkill_fop_open() 1203 mutex_destroy(&data->mtx); in rfkill_fop_open() 1217 mutex_lock(&data->mtx); in rfkill_fop_poll() 1220 mutex_unlock(&data->mtx); in rfkill_fop_poll() 1233 mutex_lock(&data->mtx); in rfkill_fop_read() [all …]
|
| /linux/drivers/video/fbdev/omap2/omapfb/ |
| H A D | omapfb.h | 80 struct mutex mtx; member 165 mutex_lock(&fbdev->mtx); in omapfb_lock() 170 mutex_unlock(&fbdev->mtx); in omapfb_unlock()
|
| /linux/drivers/net/wireless/atmel/ |
| H A D | at76c50x-usb.c | 1469 mutex_lock(&priv->mtx); in at76_work_set_promisc() 1481 mutex_unlock(&priv->mtx); in at76_work_set_promisc() 1490 mutex_lock(&priv->mtx); in at76_work_submit_rx() 1492 mutex_unlock(&priv->mtx); in at76_work_submit_rx() 1714 mutex_lock(&priv->mtx); in at76_work_join_bssid() 1719 mutex_unlock(&priv->mtx); in at76_work_join_bssid() 1834 mutex_lock(&priv->mtx); in at76_mac80211_start() 1848 mutex_unlock(&priv->mtx); in at76_mac80211_start() 1863 mutex_lock(&priv->mtx); in at76_mac80211_stop() 1875 mutex_unlock(&priv->mtx); in at76_mac80211_stop() [all …]
|
| /linux/net/mac80211/ |
| H A D | scan.c | 390 lockdep_is_held(&local->hw.wiphy->mtx)); in ieee80211_prep_hw_scan() 472 lockdep_is_held(&local->hw.wiphy->mtx)); in __ieee80211_scan_completed() 481 lockdep_is_held(&local->hw.wiphy->mtx)), in __ieee80211_scan_completed() 498 lockdep_is_held(&local->hw.wiphy->mtx)); in __ieee80211_scan_completed() 652 lockdep_is_held(&local->hw.wiphy->mtx)), in ieee80211_run_deferred_scan() 699 lockdep_is_held(&local->hw.wiphy->mtx)); in ieee80211_scan_state_send_probe() 710 lockdep_is_held(&local->hw.wiphy->mtx)); in ieee80211_scan_state_send_probe() 958 lockdep_is_held(&local->hw.wiphy->mtx)); in ieee80211_scan_state_decision() 998 lockdep_is_held(&local->hw.wiphy->mtx)); in ieee80211_scan_state_set_channel() 1112 lockdep_is_held(&local->hw.wiphy->mtx)); in ieee80211_scan_work() [all …]
|
| /linux/drivers/iio/ |
| H A D | industrialio-core.c | 604 const struct iio_mount_matrix *mtx; in iio_show_mount_matrix() local 606 mtx = ((iio_get_mount_matrix_t *)priv)(indio_dev, chan); in iio_show_mount_matrix() 607 if (IS_ERR(mtx)) in iio_show_mount_matrix() 608 return PTR_ERR(mtx); in iio_show_mount_matrix() 610 if (!mtx) in iio_show_mount_matrix() 611 mtx = &iio_mount_idmatrix; in iio_show_mount_matrix() 614 mtx->rotation[0], mtx->rotation[1], mtx->rotation[2], in iio_show_mount_matrix() 615 mtx->rotation[3], mtx->rotation[4], mtx->rotation[5], in iio_show_mount_matrix() 616 mtx->rotation[6], mtx->rotation[7], mtx->rotation[8]); in iio_show_mount_matrix()
|
| /linux/kernel/events/ |
| H A D | hw_breakpoint.c | 601 struct mutex *mtx = bp_constraints_lock(bp); in reserve_bp_slot() local 604 bp_constraints_unlock(mtx); in reserve_bp_slot() 620 struct mutex *mtx = bp_constraints_lock(bp); in release_bp_slot() local 623 bp_constraints_unlock(mtx); in release_bp_slot() 650 struct mutex *mtx = bp_constraints_lock(bp); in modify_bp_slot() local 653 bp_constraints_unlock(mtx); in modify_bp_slot()
|
| /linux/net/wireless/ |
| H A D | core.c | 232 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_stop_p2p_device() 257 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_stop_nan() 526 mutex_init(&rdev->wiphy.mtx); in wiphy_new_nm() 1138 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_process_wiphy_works() 1249 mutex_destroy(&rdev->wiphy.mtx); in cfg80211_dev_free() 1288 lockdep_assert_held(&rdev->wiphy.mtx); in _cfg80211_unregister_wdev() 1364 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_update_iface_num() 1378 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_leave() 1501 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_register_wdev() 1537 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_register_netdevice() [all …]
|