Home
last modified time | relevance | path

Searched refs:mtx (Results 1 – 25 of 49) sorted by relevance

12

/linux/tools/perf/util/
H A Dmutex.c20 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 Dmutex.h101 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 Drwsem.c12 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()
H A Drwsem.h15 struct mutex mtx; member
/linux/drivers/soc/mediatek/
H A Dmtk-mutex.c850 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 Dvirtual_ncidev.c26 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 Dmutex.rs111 mtx: self, in lock()
128 mtx: &'a CMutex<T>,
135 let sguard = self.mtx.spin_lock.acquire(); in drop()
136 self.mtx.locked.set(false); in drop()
137 if let Some(list_field) = self.mtx.wait_list.next() { in drop()
153 unsafe { &*self.mtx.data.get() } in deref()
160 unsafe { &mut *self.mtx.data.get() } in deref_mut()
197 let mtx: Pin<Arc<CMutex<usize>>> = Arc::pin_init(CMutex::new(0)).unwrap(); in main()
202 let mtx = mtx in main()
127 mtx: &'a CMutex<T>, global() field
196 let mtx: Pin<Arc<CMutex<usize>>> = Arc::pin_init(CMutex::new(0)).unwrap(); main() localVariable
201 let mtx = mtx.clone(); main() localVariable
[all...]
H A Dpthread_mutex.rs113 PThreadMutexGuard { mtx: self } in lock()
118 mtx: &'a PThreadMutex<T>,
124 unsafe { libc::pthread_mutex_unlock(self.mtx.raw.get()) }; in drop()
132 unsafe { &*self.mtx.data.get() } in deref()
138 unsafe { &mut *self.mtx.data.get() } in deref_mut()
156 let mtx: Pin<Arc<PThreadMutex<usize>>> = Arc::try_pin_init(PThreadMutex::new(0)).unwrap(); in main()
161 let mtx = mtx.clone(); in main()
167 *mtx.lock() += 1; in main()
172 *mtx in main()
117 mtx: &'a PThreadMutex<T>, global() field
155 let mtx: Pin<Arc<PThreadMutex<usize>>> = Arc::try_pin_init(PThreadMutex::new(0)).unwrap(); main() localVariable
160 let mtx = mtx.clone(); main() localVariable
[all...]
H A Dstatic_init.rs91 let mtx: Pin<Arc<CMutex<usize>>> = Arc::pin_init(CMutex::new(0)).unwrap(); in main()
96 let mtx = mtx.clone(); in main()
104 *mtx.lock() += 1; in main()
112 *mtx.lock() += 1; in main()
122 println!("{:?}, {:?}", &*mtx.lock(), &*COUNT.lock()); in main()
123 assert_eq!(*mtx.lock(), workload * thread_count * 2); in main()
90 let mtx: Pin<Arc<CMutex<usize>>> = Arc::pin_init(CMutex::new(0)).unwrap(); main() localVariable
95 let mtx = mtx.clone(); main() localVariable
/linux/kernel/locking/
H A Dtest-ww_mutex.c43 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 Dtas.c97 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 Dethtool.c166 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 Dmain.c1093 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/net/ethernet/marvell/prestera/
H A Dprestera_counter.c16 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 Deventpoll.c179 struct mutex mtx; member
692 return rcu_dereference_check(epi->ws, lockdep_is_held(&epi->ep->mtx)); in ep_wakeup_source()
812 mutex_destroy(&ep->mtx); in ep_free()
856 lockdep_assert_held(&ep->mtx); in ep_remove_file()
877 lockdep_assert_held(&ep->mtx); in ep_remove_epi()
907 lockdep_assert_held(&ep->mtx); in ep_remove()
934 mutex_lock(&ep->mtx); in ep_clear_and_put()
961 mutex_unlock(&ep->mtx); in ep_clear_and_put()
1016 mutex_lock_nested(&ep->mtx, depth); in __ep_eventpoll_poll()
1033 mutex_unlock(&ep->mtx); in __ep_eventpoll_poll()
[all …]
/linux/drivers/staging/vme_user/
H A Dvme_fake.c206 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 Dvme_tsi148.c1797 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/usb/misc/
H A Dadutux.c71 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 Dcore.c81 struct mutex mtx; member
280 scoped_guard(mutex, &data->mtx) { in rfkill_fill_event()
1189 mutex_init(&data->mtx); in rfkill_fop_open()
1215 mutex_destroy(&data->mtx); in rfkill_fop_open()
1229 mutex_lock(&data->mtx); in rfkill_fop_poll()
1232 mutex_unlock(&data->mtx); in rfkill_fop_poll()
1245 mutex_lock(&data->mtx); in rfkill_fop_read()
1252 mutex_unlock(&data->mtx); in rfkill_fop_read()
1258 mutex_lock(&data->mtx); in rfkill_fop_read()
1277 mutex_unlock(&data->mtx); in rfkill_fop_read()
[all …]
/linux/drivers/video/fbdev/omap2/omapfb/
H A Domapfb.h80 struct mutex mtx; member
165 mutex_lock(&fbdev->mtx); in omapfb_lock()
170 mutex_unlock(&fbdev->mtx); in omapfb_unlock()
/linux/drivers/iio/
H A Dindustrialio-core.c604 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/net/wireless/
H A Dcore.c232 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_stop_p2p_device()
259 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_stop_nan()
290 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_nan_set_local_schedule()
599 mutex_init(&rdev->wiphy.mtx); in wiphy_new_nm()
1215 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_process_wiphy_works()
1326 mutex_destroy(&rdev->wiphy.mtx); in cfg80211_dev_free()
1365 lockdep_assert_held(&rdev->wiphy.mtx); in _cfg80211_unregister_wdev()
1441 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_update_iface_num()
1454 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_leave_locked()
1594 lockdep_assert_held(&rdev->wiphy.mtx); in cfg80211_register_wdev()
[all …]
/linux/kernel/events/
H A Dhw_breakpoint.c601 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/drivers/watchdog/
H A Dpcwd_usb.c144 struct mutex mtx; member
650 mutex_init(&usb_pcwd->mtx); in usb_pcwd_probe()
779 mutex_lock(&usb_pcwd->mtx); in usb_pcwd_disconnect()
793 mutex_unlock(&usb_pcwd->mtx); in usb_pcwd_disconnect()
/linux/drivers/net/wireless/ath/ath10k/
H A Dsdio.c823 mutex_lock(&irq_data->mtx); in ath10k_sdio_mbox_proc_counter_intr()
836 mutex_unlock(&irq_data->mtx); in ath10k_sdio_mbox_proc_counter_intr()
894 mutex_lock(&irq_data->mtx); in ath10k_sdio_mbox_proc_cpu_intr()
922 mutex_unlock(&irq_data->mtx); in ath10k_sdio_mbox_proc_cpu_intr()
940 mutex_lock(&irq_data->mtx); in ath10k_sdio_mbox_read_int_status()
992 mutex_unlock(&irq_data->mtx); in ath10k_sdio_mbox_read_int_status()
1559 mutex_lock(&irq_data->mtx); in ath10k_sdio_disable_intrs()
1567 mutex_unlock(&irq_data->mtx); in ath10k_sdio_disable_intrs()
1687 mutex_lock(&irq_data->mtx); in ath10k_sdio_enable_intrs()
1724 mutex_unlock(&irq_data->mtx); in ath10k_sdio_enable_intrs()
[all …]

12