sem               111 arch/arm/mach-vexpress/spc.c 	struct semaphore sem;
sem               340 arch/arm/mach-vexpress/spc.c 	if (down_timeout(&info->sem, usecs_to_jiffies(TIMEOUT_US)))
sem               350 arch/arm/mach-vexpress/spc.c 	up(&info->sem);
sem               359 arch/arm/mach-vexpress/spc.c 	if (down_timeout(&info->sem, usecs_to_jiffies(TIMEOUT_US)))
sem               373 arch/arm/mach-vexpress/spc.c 	up(&info->sem);
sem               478 arch/arm/mach-vexpress/spc.c 	sema_init(&info->sem, 1);
sem                71 arch/ia64/include/uapi/asm/cmpxchg.h #define ia64_cmpxchg(sem, ptr, old, new, size)				\
sem                93 arch/ia64/include/uapi/asm/cmpxchg.h 		_r_ = ia64_cmpxchg1_##sem((__u8 *) ptr, new, _o_);	\
sem                97 arch/ia64/include/uapi/asm/cmpxchg.h 		_r_ = ia64_cmpxchg2_##sem((__u16 *) ptr, new, _o_);	\
sem               101 arch/ia64/include/uapi/asm/cmpxchg.h 		_r_ = ia64_cmpxchg4_##sem((__u32 *) ptr, new, _o_);	\
sem               105 arch/ia64/include/uapi/asm/cmpxchg.h 		_r_ = ia64_cmpxchg8_##sem((__u64 *) ptr, new, _o_);	\
sem                42 arch/ia64/include/uapi/asm/intrinsics.h #define IA64_FETCHADD(tmp,v,n,sz,sem)						\
sem                46 arch/ia64/include/uapi/asm/intrinsics.h 	        tmp = ia64_fetchadd4_##sem((unsigned int *) v, n);		\
sem                50 arch/ia64/include/uapi/asm/intrinsics.h 	        tmp = ia64_fetchadd8_##sem((unsigned long *) v, n);		\
sem                58 arch/ia64/include/uapi/asm/intrinsics.h #define ia64_fetchadd(i,v,sem)								\
sem                64 arch/ia64/include/uapi/asm/intrinsics.h 		IA64_FETCHADD(_tmp, _v, -16, sizeof(*(v)), sem);			\
sem                66 arch/ia64/include/uapi/asm/intrinsics.h 		IA64_FETCHADD(_tmp, _v, -8, sizeof(*(v)), sem);				\
sem                68 arch/ia64/include/uapi/asm/intrinsics.h 		IA64_FETCHADD(_tmp, _v, -4, sizeof(*(v)), sem);				\
sem                70 arch/ia64/include/uapi/asm/intrinsics.h 		IA64_FETCHADD(_tmp, _v, -1, sizeof(*(v)), sem);				\
sem                72 arch/ia64/include/uapi/asm/intrinsics.h 		IA64_FETCHADD(_tmp, _v, 1, sizeof(*(v)), sem);				\
sem                74 arch/ia64/include/uapi/asm/intrinsics.h 		IA64_FETCHADD(_tmp, _v, 4, sizeof(*(v)), sem);				\
sem                76 arch/ia64/include/uapi/asm/intrinsics.h 		IA64_FETCHADD(_tmp, _v, 8, sizeof(*(v)), sem);				\
sem                78 arch/ia64/include/uapi/asm/intrinsics.h 		IA64_FETCHADD(_tmp, _v, 16, sizeof(*(v)), sem);				\
sem                27 arch/mips/include/asm/pmon.h 	int	(*semlock) (int sem);
sem                28 arch/mips/include/asm/pmon.h 	void	(*semunlock) (int sem);
sem                43 arch/mips/include/asm/pmon.h #define pmon_semlock(sem)		debug_vectors->semlock(sem)
sem                44 arch/mips/include/asm/pmon.h #define pmon_semunlock(sem)		debug_vectors->semunlock(sem)
sem               247 arch/x86/platform/intel/iosf_mbi.c static int iosf_mbi_get_sem(u32 *sem)
sem               252 arch/x86/platform/intel/iosf_mbi.c 			    iosf_mbi_sem_address, sem);
sem               258 arch/x86/platform/intel/iosf_mbi.c 	*sem &= PUNIT_SEMAPHORE_BIT;
sem               316 arch/x86/platform/intel/iosf_mbi.c 	u32 sem;
sem               355 arch/x86/platform/intel/iosf_mbi.c 		ret = iosf_mbi_get_sem(&sem);
sem               356 arch/x86/platform/intel/iosf_mbi.c 		if (!ret && sem) {
sem               370 arch/x86/platform/intel/iosf_mbi.c 	if (!iosf_mbi_get_sem(&sem))
sem               371 arch/x86/platform/intel/iosf_mbi.c 		dev_err(&mbi_pdev->dev, "P-Unit semaphore: %d\n", sem);
sem              1196 drivers/acpi/osl.c 	struct semaphore *sem = NULL;
sem              1198 drivers/acpi/osl.c 	sem = acpi_os_allocate_zeroed(sizeof(struct semaphore));
sem              1199 drivers/acpi/osl.c 	if (!sem)
sem              1202 drivers/acpi/osl.c 	sema_init(sem, initial_units);
sem              1204 drivers/acpi/osl.c 	*handle = (acpi_handle *) sem;
sem              1221 drivers/acpi/osl.c 	struct semaphore *sem = (struct semaphore *)handle;
sem              1223 drivers/acpi/osl.c 	if (!sem)
sem              1228 drivers/acpi/osl.c 	BUG_ON(!list_empty(&sem->wait_list));
sem              1229 drivers/acpi/osl.c 	kfree(sem);
sem              1230 drivers/acpi/osl.c 	sem = NULL;
sem              1241 drivers/acpi/osl.c 	struct semaphore *sem = (struct semaphore *)handle;
sem              1248 drivers/acpi/osl.c 	if (!sem || (units < 1))
sem              1262 drivers/acpi/osl.c 	ret = down_timeout(sem, jiffies);
sem              1285 drivers/acpi/osl.c 	struct semaphore *sem = (struct semaphore *)handle;
sem              1290 drivers/acpi/osl.c 	if (!sem || (units < 1))
sem              1299 drivers/acpi/osl.c 	up(sem);
sem               365 drivers/char/xilinx_hwicap/xilinx_hwicap.c 	status = mutex_lock_interruptible(&drvdata->sem);
sem               436 drivers/char/xilinx_hwicap/xilinx_hwicap.c 	mutex_unlock(&drvdata->sem);
sem               451 drivers/char/xilinx_hwicap/xilinx_hwicap.c 	status = mutex_lock_interruptible(&drvdata->sem);
sem               525 drivers/char/xilinx_hwicap/xilinx_hwicap.c 	mutex_unlock(&drvdata->sem);
sem               537 drivers/char/xilinx_hwicap/xilinx_hwicap.c 	status = mutex_lock_interruptible(&drvdata->sem);
sem               558 drivers/char/xilinx_hwicap/xilinx_hwicap.c 	mutex_unlock(&drvdata->sem);
sem               570 drivers/char/xilinx_hwicap/xilinx_hwicap.c 	mutex_lock(&drvdata->sem);
sem               589 drivers/char/xilinx_hwicap/xilinx_hwicap.c 	mutex_unlock(&drvdata->sem);
sem               674 drivers/char/xilinx_hwicap/xilinx_hwicap.c 	mutex_init(&drvdata->sem);
sem                60 drivers/char/xilinx_hwicap/xilinx_hwicap.h 	struct mutex sem;
sem               179 drivers/cpufreq/brcmstb-avs-cpufreq.c 	struct semaphore sem;
sem               207 drivers/cpufreq/brcmstb-avs-cpufreq.c 	ret = down_interruptible(&priv->sem);
sem               288 drivers/cpufreq/brcmstb-avs-cpufreq.c 	up(&priv->sem);
sem               520 drivers/cpufreq/brcmstb-avs-cpufreq.c 	sema_init(&priv->sem, 1);
sem               385 drivers/gpu/drm/gma500/gtt.c 	init_rwsem(&dev_priv->gtt.sem);
sem                23 drivers/gpu/drm/gma500/gtt.h 	struct rw_semaphore sem;
sem                96 drivers/gpu/drm/gma500/mmu.c 	down_write(&driver->sem);
sem                98 drivers/gpu/drm/gma500/mmu.c 	up_write(&driver->sem);
sem               108 drivers/gpu/drm/gma500/mmu.c 	down_write(&driver->sem);
sem               125 drivers/gpu/drm/gma500/mmu.c 	up_write(&driver->sem);
sem               135 drivers/gpu/drm/gma500/mmu.c 	down_write(&pd->driver->sem);
sem               140 drivers/gpu/drm/gma500/mmu.c 	up_write(&pd->driver->sem);
sem               245 drivers/gpu/drm/gma500/mmu.c 	down_write(&driver->sem);
sem               265 drivers/gpu/drm/gma500/mmu.c 	up_write(&driver->sem);
sem               412 drivers/gpu/drm/gma500/mmu.c 	down_read(&driver->sem);
sem               414 drivers/gpu/drm/gma500/mmu.c 	up_read(&driver->sem);
sem               458 drivers/gpu/drm/gma500/mmu.c 	init_rwsem(&driver->sem);
sem               459 drivers/gpu/drm/gma500/mmu.c 	down_write(&driver->sem);
sem               490 drivers/gpu/drm/gma500/mmu.c 	up_write(&driver->sem);
sem               564 drivers/gpu/drm/gma500/mmu.c 	down_read(&pd->driver->sem);
sem               586 drivers/gpu/drm/gma500/mmu.c 	up_read(&pd->driver->sem);
sem               616 drivers/gpu/drm/gma500/mmu.c 	down_read(&pd->driver->sem);
sem               644 drivers/gpu/drm/gma500/mmu.c 	up_read(&pd->driver->sem);
sem               662 drivers/gpu/drm/gma500/mmu.c 	down_read(&pd->driver->sem);
sem               688 drivers/gpu/drm/gma500/mmu.c 	up_read(&pd->driver->sem);
sem               724 drivers/gpu/drm/gma500/mmu.c 	down_read(&pd->driver->sem);
sem               755 drivers/gpu/drm/gma500/mmu.c 	up_read(&pd->driver->sem);
sem               771 drivers/gpu/drm/gma500/mmu.c 	down_read(&pd->driver->sem);
sem               800 drivers/gpu/drm/gma500/mmu.c 	up_read(&pd->driver->sem);
sem                15 drivers/gpu/drm/gma500/mmu.h 	struct rw_semaphore sem;
sem               170 drivers/gpu/drm/gma500/psb_drv.c 			down_read(&pg->sem);
sem               176 drivers/gpu/drm/gma500/psb_drv.c 			up_read(&pg->sem);
sem               329 drivers/gpu/drm/gma500/psb_drv.c 	down_read(&pg->sem);
sem               334 drivers/gpu/drm/gma500/psb_drv.c 	up_read(&pg->sem);
sem               247 drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.c 	u32 reassign, chid, get, sem;
sem               269 drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.c 		sem = nvkm_rd32(device, NV10_PFIFO_CACHE1_SEMAPHORE);
sem               270 drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.c 		nvkm_wr32(device, NV10_PFIFO_CACHE1_SEMAPHORE, sem | 0x1);
sem               170 drivers/gpu/drm/radeon/radeon_trace.h 	    TP_PROTO(int ring, struct radeon_semaphore *sem),
sem               172 drivers/gpu/drm/radeon/radeon_trace.h 	    TP_ARGS(ring, sem),
sem               182 drivers/gpu/drm/radeon/radeon_trace.h 			   __entry->waiters = sem->waiters;
sem               183 drivers/gpu/drm/radeon/radeon_trace.h 			   __entry->gpu_addr = sem->gpu_addr;
sem               192 drivers/gpu/drm/radeon/radeon_trace.h 	    TP_PROTO(int ring, struct radeon_semaphore *sem),
sem               194 drivers/gpu/drm/radeon/radeon_trace.h 	    TP_ARGS(ring, sem)
sem               199 drivers/gpu/drm/radeon/radeon_trace.h 	    TP_PROTO(int ring, struct radeon_semaphore *sem),
sem               201 drivers/gpu/drm/radeon/radeon_trace.h 	    TP_ARGS(ring, sem)
sem               454 drivers/infiniband/core/iwpm_msg.c 	up(&nlmsg_request->sem);
sem               526 drivers/infiniband/core/iwpm_msg.c 	up(&nlmsg_request->sem);
sem               623 drivers/infiniband/core/iwpm_msg.c 	up(&nlmsg_request->sem);
sem               832 drivers/infiniband/core/iwpm_msg.c 	up(&nlmsg_request->sem);
sem               361 drivers/infiniband/core/iwpm_util.c 	sema_init(&nlmsg_request->sem, 1);
sem               362 drivers/infiniband/core/iwpm_util.c 	down(&nlmsg_request->sem);
sem               406 drivers/infiniband/core/iwpm_util.c 	ret = down_timeout(&nlmsg_request->sem, IWPM_NL_TIMEOUT);
sem                72 drivers/infiniband/core/iwpm_util.h 	struct semaphore    sem;
sem                50 drivers/infiniband/core/netlink.c 	struct rw_semaphore sem;
sem                99 drivers/infiniband/core/netlink.c 		up_read(&rdma_nl_types[type].sem);
sem               103 drivers/infiniband/core/netlink.c 		down_read(&rdma_nl_types[type].sem);
sem               125 drivers/infiniband/core/netlink.c 	down_write(&rdma_nl_types[index].sem);
sem               127 drivers/infiniband/core/netlink.c 	up_write(&rdma_nl_types[index].sem);
sem               164 drivers/infiniband/core/netlink.c 	down_read(&rdma_nl_types[index].sem);
sem               197 drivers/infiniband/core/netlink.c 	up_read(&rdma_nl_types[index].sem);
sem               296 drivers/infiniband/core/netlink.c 		init_rwsem(&rdma_nl_types[idx].sem);
sem              4885 drivers/infiniband/hw/mlx5/main.c 	sema_init(&dev->umrc.sem, MAX_UMR_WR);
sem               657 drivers/infiniband/hw/mlx5/mlx5_ib.h 	struct semaphore	sem;
sem               833 drivers/infiniband/hw/mlx5/mr.c 	down(&umrc->sem);
sem               845 drivers/infiniband/hw/mlx5/mr.c 	up(&umrc->sem);
sem               610 drivers/infiniband/ulp/isert/ib_isert.c 	up(&isert_np->sem);
sem              2350 drivers/infiniband/ulp/isert/ib_isert.c 	sema_init(&isert_np->sem, 0);
sem              2466 drivers/infiniband/ulp/isert/ib_isert.c 	ret = down_interruptible(&isert_np->sem);
sem               196 drivers/infiniband/ulp/isert/ib_isert.h 	struct semaphore	sem;
sem                69 drivers/input/joystick/turbografx.c 	struct mutex sem;
sem               111 drivers/input/joystick/turbografx.c 	err = mutex_lock_interruptible(&tgfx->sem);
sem               121 drivers/input/joystick/turbografx.c 	mutex_unlock(&tgfx->sem);
sem               129 drivers/input/joystick/turbografx.c 	mutex_lock(&tgfx->sem);
sem               135 drivers/input/joystick/turbografx.c 	mutex_unlock(&tgfx->sem);
sem               184 drivers/input/joystick/turbografx.c 	mutex_init(&tgfx->sem);
sem               841 drivers/iommu/amd_iommu.c static int wait_on_sem(volatile u64 *sem)
sem               845 drivers/iommu/amd_iommu.c 	while (*sem == 0 && i < LOOP_TIMEOUT) {
sem                70 drivers/macintosh/rack-meter.c 	struct mutex			sem;
sem               248 drivers/macintosh/rack-meter.c 		mutex_lock(&rm->sem);
sem               251 drivers/macintosh/rack-meter.c 		mutex_unlock(&rm->sem);
sem               407 drivers/macintosh/rack-meter.c 	mutex_init(&rm->sem);
sem              1944 drivers/md/dm-crypt.c 	down_read(&key->sem);
sem              1948 drivers/md/dm-crypt.c 		up_read(&key->sem);
sem              1955 drivers/md/dm-crypt.c 		up_read(&key->sem);
sem              1963 drivers/md/dm-crypt.c 	up_read(&key->sem);
sem                43 drivers/md/dm-verity-verify-sig.c 	down_read(&key->sem);
sem                61 drivers/md/dm-verity-verify-sig.c 	up_read(&key->sem);
sem                97 drivers/media/dvb-core/dvb_frontend.c 	struct semaphore sem;
sem               274 drivers/media/dvb-core/dvb_frontend.c 	up(&fepriv->sem);
sem               276 drivers/media/dvb-core/dvb_frontend.c 	down(&fepriv->sem);
sem               668 drivers/media/dvb-core/dvb_frontend.c 		up(&fepriv->sem);	    /* is locked when we enter the thread... */
sem               678 drivers/media/dvb-core/dvb_frontend.c 			if (!down_interruptible(&fepriv->sem))
sem               687 drivers/media/dvb-core/dvb_frontend.c 		if (down_interruptible(&fepriv->sem))
sem               796 drivers/media/dvb-core/dvb_frontend.c 		up(&fepriv->sem);
sem               816 drivers/media/dvb-core/dvb_frontend.c 	sema_init(&fepriv->sem, 1);
sem               865 drivers/media/dvb-core/dvb_frontend.c 	if (down_interruptible(&fepriv->sem))
sem               880 drivers/media/dvb-core/dvb_frontend.c 		up(&fepriv->sem);
sem              1996 drivers/media/dvb-core/dvb_frontend.c 	if (down_interruptible(&fepriv->sem))
sem              2000 drivers/media/dvb-core/dvb_frontend.c 		up(&fepriv->sem);
sem              2021 drivers/media/dvb-core/dvb_frontend.c 		up(&fepriv->sem);
sem              2027 drivers/media/dvb-core/dvb_frontend.c 	up(&fepriv->sem);
sem              2168 drivers/media/dvb-core/dvb_frontend.c 		if (down_interruptible(&fepriv->sem))
sem              2173 drivers/media/dvb-core/dvb_frontend.c 		up(&fepriv->sem);
sem              2986 drivers/media/dvb-core/dvb_frontend.c 	sema_init(&fepriv->sem, 1);
sem               139 drivers/media/usb/as102/as102_drv.c 	if (mutex_lock_interruptible(&as102_dev->sem))
sem               149 drivers/media/usb/as102/as102_drv.c 	mutex_unlock(&as102_dev->sem);
sem               158 drivers/media/usb/as102/as102_drv.c 	if (mutex_lock_interruptible(&as102_dev->sem))
sem               168 drivers/media/usb/as102/as102_drv.c 	mutex_unlock(&as102_dev->sem);
sem               348 drivers/media/usb/as102/as102_drv.c 	mutex_init(&as102_dev->sem);
sem                64 drivers/media/usb/as102/as102_drv.h 	struct mutex sem;
sem                27 drivers/misc/cxl/flash.c static struct semaphore sem;
sem               402 drivers/misc/cxl/flash.c 	if (down_interruptible(&sem) != 0)
sem               453 drivers/misc/cxl/flash.c 	up(&sem);
sem               497 drivers/misc/cxl/flash.c 	up(&sem);
sem               540 drivers/misc/cxl/flash.c 	sema_init(&sem, 1);
sem               710 drivers/net/ethernet/emulex/benet/be_cmds.c 	u32 sem;
sem               713 drivers/net/ethernet/emulex/benet/be_cmds.c 		sem  = ioread32(adapter->csr + SLIPORT_SEMAPHORE_OFFSET_BEx);
sem               716 drivers/net/ethernet/emulex/benet/be_cmds.c 				      SLIPORT_SEMAPHORE_OFFSET_SH, &sem);
sem               718 drivers/net/ethernet/emulex/benet/be_cmds.c 	return sem & POST_STAGE_MASK;
sem               363 drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.c 	down(&chain->sem);
sem               365 drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.c 		up(&chain->sem);
sem               382 drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.c 	up(&chain->sem);
sem               808 drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.c 	sema_init(&chain->sem, 1);
sem               179 drivers/net/ethernet/huawei/hinic/hinic_hw_api_cmd.h 	struct semaphore                sem;
sem                51 drivers/net/ethernet/mellanox/mlx4/reset.c 	u32 sem;
sem               104 drivers/net/ethernet/mellanox/mlx4/reset.c 		sem = readl(reset + MLX4_SEM_OFFSET);
sem               105 drivers/net/ethernet/mellanox/mlx4/reset.c 		if (!sem)
sem               111 drivers/net/ethernet/mellanox/mlx4/reset.c 	if (sem) {
sem               858 drivers/net/ethernet/mellanox/mlx5/core/cmd.c 	struct semaphore *sem;
sem               865 drivers/net/ethernet/mellanox/mlx5/core/cmd.c 	sem = ent->page_queue ? &cmd->pages_sem : &cmd->sem;
sem               866 drivers/net/ethernet/mellanox/mlx5/core/cmd.c 	down(sem);
sem               880 drivers/net/ethernet/mellanox/mlx5/core/cmd.c 			up(sem);
sem              1414 drivers/net/ethernet/mellanox/mlx5/core/cmd.c 		down(&cmd->sem);
sem              1421 drivers/net/ethernet/mellanox/mlx5/core/cmd.c 		up(&cmd->sem);
sem              1482 drivers/net/ethernet/mellanox/mlx5/core/cmd.c 			struct semaphore *sem;
sem              1502 drivers/net/ethernet/mellanox/mlx5/core/cmd.c 				sem = &cmd->pages_sem;
sem              1504 drivers/net/ethernet/mellanox/mlx5/core/cmd.c 				sem = &cmd->sem;
sem              1559 drivers/net/ethernet/mellanox/mlx5/core/cmd.c 			up(sem);
sem              1593 drivers/net/ethernet/mellanox/mlx5/core/cmd.c 		while (down_trylock(&cmd->sem))
sem              1602 drivers/net/ethernet/mellanox/mlx5/core/cmd.c 		up(&cmd->sem);
sem              1971 drivers/net/ethernet/mellanox/mlx5/core/cmd.c 	sema_init(&cmd->sem, cmd->max_reg_cmds);
sem                20 drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c 	struct rw_semaphore sem;
sem                47 drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c 		init_rwsem(&comp->sem);
sem               161 drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c 	down_write(&comp->sem);
sem               164 drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c 	up_write(&comp->sem);
sem               176 drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c 	down_write(&comp->sem);
sem               178 drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c 	up_write(&comp->sem);
sem               193 drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c 	down_write(&comp->sem);
sem               201 drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c 	up_write(&comp->sem);
sem               212 drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c 	WARN_ON(!rwsem_is_locked(&comp->sem));
sem               236 drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c 	down_read(&comp->sem);
sem               238 drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c 		up_read(&comp->sem);
sem               254 drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c 	up_read(&comp->sem);
sem               293 drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c netxen_pcie_sem_lock(struct netxen_adapter *adapter, int sem, u32 id_reg)
sem               298 drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c 		done = NXRD32(adapter, NETXEN_PCIE_REG(PCIE_SEM_LOCK(sem)));
sem               313 drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c netxen_pcie_sem_unlock(struct netxen_adapter *adapter, int sem)
sem               315 drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c 	NXRD32(adapter, NETXEN_PCIE_REG(PCIE_SEM_UNLOCK(sem)));
sem               311 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c qlcnic_pcie_sem_lock(struct qlcnic_adapter *adapter, int sem, u32 id_reg)
sem               316 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c 		done = QLCRD32(adapter, QLCNIC_PCIE_REG(PCIE_SEM_LOCK(sem)),
sem               326 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c 						sem, done);
sem               330 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c 						sem);
sem               333 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c 					"Failed to acquire sem=%d lock", sem);
sem               347 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c qlcnic_pcie_sem_unlock(struct qlcnic_adapter *adapter, int sem)
sem               351 drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c 	QLCRD32(adapter, QLCNIC_PCIE_REG(PCIE_SEM_UNLOCK(sem)), &err);
sem               316 drivers/net/ethernet/sfc/efx.h static inline bool efx_rwsem_assert_write_locked(struct rw_semaphore *sem)
sem               318 drivers/net/ethernet/sfc/efx.h 	if (WARN_ON(down_read_trylock(sem))) {
sem               319 drivers/net/ethernet/sfc/efx.h 		up_read(sem);
sem               265 drivers/net/ethernet/sfc/falcon/efx.h static inline bool ef4_rwsem_assert_write_locked(struct rw_semaphore *sem)
sem               267 drivers/net/ethernet/sfc/falcon/efx.h 	if (WARN_ON(down_read_trylock(sem))) {
sem               268 drivers/net/ethernet/sfc/falcon/efx.h 		up_read(sem);
sem               482 drivers/net/wireless/ath/ath6kl/cfg80211.c 	if (down_interruptible(&ar->sem)) {
sem               489 drivers/net/wireless/ath/ath6kl/cfg80211.c 		up(&ar->sem);
sem               502 drivers/net/wireless/ath/ath6kl/cfg80211.c 			up(&ar->sem);
sem               509 drivers/net/wireless/ath/ath6kl/cfg80211.c 		up(&ar->sem);
sem               524 drivers/net/wireless/ath/ath6kl/cfg80211.c 		up(&ar->sem);
sem               550 drivers/net/wireless/ath/ath6kl/cfg80211.c 		up(&ar->sem);
sem               572 drivers/net/wireless/ath/ath6kl/cfg80211.c 			up(&ar->sem);
sem               596 drivers/net/wireless/ath/ath6kl/cfg80211.c 			up(&ar->sem);
sem               628 drivers/net/wireless/ath/ath6kl/cfg80211.c 			up(&ar->sem);
sem               653 drivers/net/wireless/ath/ath6kl/cfg80211.c 	up(&ar->sem);
sem               840 drivers/net/wireless/ath/ath6kl/cfg80211.c 	if (down_interruptible(&ar->sem)) {
sem               853 drivers/net/wireless/ath/ath6kl/cfg80211.c 	up(&ar->sem);
sem              1788 drivers/net/wireless/ath/ath6kl/cfg80211.c 	if (down_interruptible(&ar->sem))
sem              1796 drivers/net/wireless/ath/ath6kl/cfg80211.c 		up(&ar->sem);
sem              1805 drivers/net/wireless/ath/ath6kl/cfg80211.c 	up(&ar->sem);
sem               286 drivers/net/wireless/ath/ath6kl/core.c 	sema_init(&ar->sem, 1);
sem               724 drivers/net/wireless/ath/ath6kl/core.h 	struct semaphore sem;
sem               105 drivers/net/wireless/ath/ath6kl/debug.c 	if (down_interruptible(&ar->sem))
sem               111 drivers/net/wireless/ath/ath6kl/debug.c 		up(&ar->sem);
sem               119 drivers/net/wireless/ath/ath6kl/debug.c 	up(&ar->sem);
sem              1169 drivers/net/wireless/ath/ath6kl/debug.c 	if (down_interruptible(&ar->sem))
sem              1176 drivers/net/wireless/ath/ath6kl/debug.c 		up(&ar->sem);
sem              1182 drivers/net/wireless/ath/ath6kl/debug.c 	up(&ar->sem);
sem              1893 drivers/net/wireless/ath/ath6kl/init.c 	if (down_interruptible(&ar->sem)) {
sem              1941 drivers/net/wireless/ath/ath6kl/init.c 	up(&ar->sem);
sem              1209 drivers/net/wireless/cisco/airo.c 	struct semaphore sem;
sem              1334 drivers/net/wireless/cisco/airo.c 	up(&ai->sem);
sem              1751 drivers/net/wireless/cisco/airo.c 		if (down_interruptible(&ai->sem))
sem              1755 drivers/net/wireless/cisco/airo.c 		up(&ai->sem);
sem              2107 drivers/net/wireless/cisco/airo.c 	up(&priv->sem);
sem              2157 drivers/net/wireless/cisco/airo.c 	if (down_trylock(&priv->sem) != 0) {
sem              2178 drivers/net/wireless/cisco/airo.c 	up(&priv->sem);
sem              2235 drivers/net/wireless/cisco/airo.c 	if (down_trylock(&priv->sem) != 0) {
sem              2253 drivers/net/wireless/cisco/airo.c 		up(&ai->sem);
sem              2257 drivers/net/wireless/cisco/airo.c 	up(&ai->sem);
sem              2285 drivers/net/wireless/cisco/airo.c 		if (down_trylock(&local->sem) != 0) {
sem              2304 drivers/net/wireless/cisco/airo.c 	up(&ai->sem);
sem              2312 drivers/net/wireless/cisco/airo.c 		if (down_trylock(&ai->sem) != 0) {
sem              2706 drivers/net/wireless/cisco/airo.c 	if (lock && down_interruptible(&ai->sem))
sem              2714 drivers/net/wireless/cisco/airo.c 		up(&ai->sem);
sem              2800 drivers/net/wireless/cisco/airo.c 	sema_init(&ai->sem, 1);
sem              2988 drivers/net/wireless/cisco/airo.c 	up(&ai->sem);
sem              3048 drivers/net/wireless/cisco/airo.c 	up(&ai->sem);
sem              3076 drivers/net/wireless/cisco/airo.c 			locked = down_interruptible(&ai->sem);
sem              3125 drivers/net/wireless/cisco/airo.c 			up(&ai->sem);
sem              3130 drivers/net/wireless/cisco/airo.c 			up(&ai->sem);
sem              3153 drivers/net/wireless/cisco/airo.c 			up(&ai->sem);
sem              3266 drivers/net/wireless/cisco/airo.c 		if (down_trylock(&ai->sem) != 0) {
sem              3586 drivers/net/wireless/cisco/airo.c 	if (lock && down_interruptible(&ai->sem))
sem              3599 drivers/net/wireless/cisco/airo.c 	    up(&ai->sem);
sem              3615 drivers/net/wireless/cisco/airo.c 	if (lock == 1 && down_interruptible(&ai->sem))
sem              3627 drivers/net/wireless/cisco/airo.c 		up(&ai->sem);
sem              3822 drivers/net/wireless/cisco/airo.c 	if (lock && down_interruptible(&ai->sem))
sem              3826 drivers/net/wireless/cisco/airo.c 			up(&ai->sem);
sem              3836 drivers/net/wireless/cisco/airo.c 				up(&ai->sem);
sem              3849 drivers/net/wireless/cisco/airo.c 		up(&ai->sem);
sem              4136 drivers/net/wireless/cisco/airo.c 		if (down_interruptible(&ai->sem))
sem              4189 drivers/net/wireless/cisco/airo.c 		up(&ai->sem);
sem              4204 drivers/net/wireless/cisco/airo.c 		if (down_interruptible(&ai->sem))
sem              4263 drivers/net/wireless/cisco/airo.c 		up(&ai->sem);
sem              4279 drivers/net/wireless/cisco/airo.c 	if (down_interruptible(&ai->sem))
sem              4319 drivers/net/wireless/cisco/airo.c 	up(&ai->sem);
sem              5463 drivers/net/wireless/cisco/airo.c 			if (down_interruptible(&ai->sem)) {
sem              5469 drivers/net/wireless/cisco/airo.c 			up(&ai->sem);
sem              5545 drivers/net/wireless/cisco/airo.c 	up(&apriv->sem);
sem              5598 drivers/net/wireless/cisco/airo.c 	if (down_interruptible(&ai->sem))
sem              5649 drivers/net/wireless/cisco/airo.c 	up(&ai->sem);
sem              5948 drivers/net/wireless/cisco/airo.c 		if (down_interruptible(&local->sem))
sem              5951 drivers/net/wireless/cisco/airo.c 		up(&local->sem);
sem              7229 drivers/net/wireless/cisco/airo.c 	if (down_interruptible(&ai->sem))
sem              7252 drivers/net/wireless/cisco/airo.c 	up(&ai->sem);
sem              7455 drivers/net/wireless/cisco/airo.c 	if (down_interruptible(&ai->sem))
sem              7477 drivers/net/wireless/cisco/airo.c 	up(&ai->sem);
sem              7510 drivers/net/wireless/cisco/airo.c 	if (down_interruptible(&local->sem))
sem              7517 drivers/net/wireless/cisco/airo.c 		up(&local->sem);
sem              7714 drivers/net/wireless/cisco/airo.c 		up(&local->sem);
sem              7720 drivers/net/wireless/cisco/airo.c 	up(&local->sem);
sem              7765 drivers/net/wireless/cisco/airo.c 		if (down_trylock(&local->sem) != 0) {
sem               338 drivers/net/wireless/mediatek/mt76/mt7615/mcu.c 	int len, ret, sem;
sem               340 drivers/net/wireless/mediatek/mt76/mt7615/mcu.c 	sem = mt7615_mcu_patch_sem_ctrl(dev, 1);
sem               341 drivers/net/wireless/mediatek/mt76/mt7615/mcu.c 	switch (sem) {
sem               388 drivers/net/wireless/mediatek/mt76/mt7615/mcu.c 	sem = mt7615_mcu_patch_sem_ctrl(dev, 0);
sem               389 drivers/net/wireless/mediatek/mt76/mt7615/mcu.c 	switch (sem) {
sem                31 drivers/nvdimm/security.c 	lockdep_assert_held_read(&key->sem);
sem                41 drivers/nvdimm/security.c 	up_read(&key->sem);
sem                68 drivers/nvdimm/security.c 		down_read(&key->sem);
sem                71 drivers/nvdimm/security.c 			up_read(&key->sem);
sem               110 drivers/nvdimm/security.c 	down_read_nested(&key->sem, subclass);
sem               113 drivers/nvdimm/security.c 		up_read(&key->sem);
sem              1069 drivers/pci/pcie/aspm.c static int __pci_disable_link_state(struct pci_dev *pdev, int state, bool sem)
sem              1095 drivers/pci/pcie/aspm.c 	if (sem)
sem              1109 drivers/pci/pcie/aspm.c 	if (sem)
sem              1607 drivers/scsi/be2iscsi/be_cmds.c 	u32 sem;
sem              1610 drivers/scsi/be2iscsi/be_cmds.c 		sem = ioread32(phba->csr_va + SLIPORT_SEMAPHORE_OFFSET_BEx);
sem              1613 drivers/scsi/be2iscsi/be_cmds.c 				      SLIPORT_SEMAPHORE_OFFSET_SH, &sem);
sem              1614 drivers/scsi/be2iscsi/be_cmds.c 	return sem;
sem               345 drivers/scsi/hisi_sas/hisi_sas.h 	struct semaphore sem;
sem               599 drivers/scsi/hisi_sas/hisi_sas_main.c 		down(&hisi_hba->sem);
sem               600 drivers/scsi/hisi_sas/hisi_sas_main.c 		up(&hisi_hba->sem);
sem              1059 drivers/scsi/hisi_sas/hisi_sas_main.c 	down(&hisi_hba->sem);
sem              1074 drivers/scsi/hisi_sas/hisi_sas_main.c 	up(&hisi_hba->sem);
sem              1531 drivers/scsi/hisi_sas/hisi_sas_main.c 	down(&hisi_hba->sem);
sem              1558 drivers/scsi/hisi_sas/hisi_sas_main.c 	up(&hisi_hba->sem);
sem              1589 drivers/scsi/hisi_sas/hisi_sas_main.c 		up(&hisi_hba->sem);
sem              2311 drivers/scsi/hisi_sas/hisi_sas_main.c 	sema_init(&hisi_hba->sem, 1);
sem               275 drivers/staging/kpc2000/kpc2000/cell_probe.c 	mutex_lock(&pcard->sem);
sem               282 drivers/staging/kpc2000/kpc2000/cell_probe.c 	mutex_unlock(&pcard->sem);
sem               322 drivers/staging/kpc2000/kpc2000/core.c 	mutex_init(&pcard->sem);
sem               323 drivers/staging/kpc2000/kpc2000/core.c 	mutex_lock(&pcard->sem);
sem               469 drivers/staging/kpc2000/kpc2000/core.c 	mutex_unlock(&pcard->sem);
sem               489 drivers/staging/kpc2000/kpc2000/core.c 	mutex_unlock(&pcard->sem);
sem               503 drivers/staging/kpc2000/kpc2000/core.c 	mutex_lock(&pcard->sem);
sem               521 drivers/staging/kpc2000/kpc2000/core.c 	mutex_unlock(&pcard->sem);
sem                55 drivers/staging/kpc2000/kpc2000/pcie.h 	struct mutex		sem;
sem               115 drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c 	mutex_init(&ldev->sem);
sem                30 drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.h 	struct mutex                sem;
sem               202 drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.h 	mutex_lock(&eng->sem);
sem               209 drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.h 	mutex_unlock(&eng->sem);
sem                57 drivers/tty/tty_ldsem.c void __init_ldsem(struct ld_semaphore *sem, const char *name,
sem                64 drivers/tty/tty_ldsem.c 	debug_check_no_locks_freed((void *)sem, sizeof(*sem));
sem                65 drivers/tty/tty_ldsem.c 	lockdep_init_map(&sem->dep_map, name, key, 0);
sem                67 drivers/tty/tty_ldsem.c 	atomic_long_set(&sem->count, LDSEM_UNLOCKED);
sem                68 drivers/tty/tty_ldsem.c 	sem->wait_readers = 0;
sem                69 drivers/tty/tty_ldsem.c 	raw_spin_lock_init(&sem->wait_lock);
sem                70 drivers/tty/tty_ldsem.c 	INIT_LIST_HEAD(&sem->read_wait);
sem                71 drivers/tty/tty_ldsem.c 	INIT_LIST_HEAD(&sem->write_wait);
sem                74 drivers/tty/tty_ldsem.c static void __ldsem_wake_readers(struct ld_semaphore *sem)
sem                85 drivers/tty/tty_ldsem.c 	adjust = sem->wait_readers * (LDSEM_ACTIVE_BIAS - LDSEM_WAIT_BIAS);
sem                86 drivers/tty/tty_ldsem.c 	count = atomic_long_add_return(adjust, &sem->count);
sem                90 drivers/tty/tty_ldsem.c 		if (atomic_long_try_cmpxchg(&sem->count, &count, count - adjust))
sem                94 drivers/tty/tty_ldsem.c 	list_for_each_entry_safe(waiter, next, &sem->read_wait, list) {
sem               100 drivers/tty/tty_ldsem.c 	INIT_LIST_HEAD(&sem->read_wait);
sem               101 drivers/tty/tty_ldsem.c 	sem->wait_readers = 0;
sem               104 drivers/tty/tty_ldsem.c static inline int writer_trylock(struct ld_semaphore *sem)
sem               110 drivers/tty/tty_ldsem.c 	long count = atomic_long_add_return(LDSEM_ACTIVE_BIAS, &sem->count);
sem               114 drivers/tty/tty_ldsem.c 		if (atomic_long_try_cmpxchg(&sem->count, &count, count - LDSEM_ACTIVE_BIAS))
sem               119 drivers/tty/tty_ldsem.c static void __ldsem_wake_writer(struct ld_semaphore *sem)
sem               123 drivers/tty/tty_ldsem.c 	waiter = list_entry(sem->write_wait.next, struct ldsem_waiter, list);
sem               135 drivers/tty/tty_ldsem.c static void __ldsem_wake(struct ld_semaphore *sem)
sem               137 drivers/tty/tty_ldsem.c 	if (!list_empty(&sem->write_wait))
sem               138 drivers/tty/tty_ldsem.c 		__ldsem_wake_writer(sem);
sem               139 drivers/tty/tty_ldsem.c 	else if (!list_empty(&sem->read_wait))
sem               140 drivers/tty/tty_ldsem.c 		__ldsem_wake_readers(sem);
sem               143 drivers/tty/tty_ldsem.c static void ldsem_wake(struct ld_semaphore *sem)
sem               147 drivers/tty/tty_ldsem.c 	raw_spin_lock_irqsave(&sem->wait_lock, flags);
sem               148 drivers/tty/tty_ldsem.c 	__ldsem_wake(sem);
sem               149 drivers/tty/tty_ldsem.c 	raw_spin_unlock_irqrestore(&sem->wait_lock, flags);
sem               156 drivers/tty/tty_ldsem.c down_read_failed(struct ld_semaphore *sem, long count, long timeout)
sem               162 drivers/tty/tty_ldsem.c 	raw_spin_lock_irq(&sem->wait_lock);
sem               170 drivers/tty/tty_ldsem.c 		if (atomic_long_try_cmpxchg(&sem->count, &count, count + adjust)) {
sem               175 drivers/tty/tty_ldsem.c 			raw_spin_unlock_irq(&sem->wait_lock);
sem               176 drivers/tty/tty_ldsem.c 			return sem;
sem               180 drivers/tty/tty_ldsem.c 	list_add_tail(&waiter.list, &sem->read_wait);
sem               181 drivers/tty/tty_ldsem.c 	sem->wait_readers++;
sem               188 drivers/tty/tty_ldsem.c 		__ldsem_wake(sem);
sem               190 drivers/tty/tty_ldsem.c 	raw_spin_unlock_irq(&sem->wait_lock);
sem               211 drivers/tty/tty_ldsem.c 		raw_spin_lock_irq(&sem->wait_lock);
sem               213 drivers/tty/tty_ldsem.c 			atomic_long_add_return(-LDSEM_WAIT_BIAS, &sem->count);
sem               214 drivers/tty/tty_ldsem.c 			sem->wait_readers--;
sem               216 drivers/tty/tty_ldsem.c 			raw_spin_unlock_irq(&sem->wait_lock);
sem               220 drivers/tty/tty_ldsem.c 		raw_spin_unlock_irq(&sem->wait_lock);
sem               223 drivers/tty/tty_ldsem.c 	return sem;
sem               230 drivers/tty/tty_ldsem.c down_write_failed(struct ld_semaphore *sem, long count, long timeout)
sem               237 drivers/tty/tty_ldsem.c 	raw_spin_lock_irq(&sem->wait_lock);
sem               245 drivers/tty/tty_ldsem.c 		if (atomic_long_try_cmpxchg(&sem->count, &count, count + adjust))
sem               248 drivers/tty/tty_ldsem.c 			raw_spin_unlock_irq(&sem->wait_lock);
sem               249 drivers/tty/tty_ldsem.c 			return sem;
sem               253 drivers/tty/tty_ldsem.c 	list_add_tail(&waiter.list, &sem->write_wait);
sem               261 drivers/tty/tty_ldsem.c 		raw_spin_unlock_irq(&sem->wait_lock);
sem               263 drivers/tty/tty_ldsem.c 		raw_spin_lock_irq(&sem->wait_lock);
sem               265 drivers/tty/tty_ldsem.c 		locked = writer_trylock(sem);
sem               271 drivers/tty/tty_ldsem.c 		atomic_long_add_return(-LDSEM_WAIT_BIAS, &sem->count);
sem               280 drivers/tty/tty_ldsem.c 	if (!locked && list_empty(&sem->write_wait))
sem               281 drivers/tty/tty_ldsem.c 		__ldsem_wake_readers(sem);
sem               283 drivers/tty/tty_ldsem.c 	raw_spin_unlock_irq(&sem->wait_lock);
sem               290 drivers/tty/tty_ldsem.c 	return sem;
sem               295 drivers/tty/tty_ldsem.c static int __ldsem_down_read_nested(struct ld_semaphore *sem,
sem               300 drivers/tty/tty_ldsem.c 	rwsem_acquire_read(&sem->dep_map, subclass, 0, _RET_IP_);
sem               302 drivers/tty/tty_ldsem.c 	count = atomic_long_add_return(LDSEM_READ_BIAS, &sem->count);
sem               304 drivers/tty/tty_ldsem.c 		lock_contended(&sem->dep_map, _RET_IP_);
sem               305 drivers/tty/tty_ldsem.c 		if (!down_read_failed(sem, count, timeout)) {
sem               306 drivers/tty/tty_ldsem.c 			rwsem_release(&sem->dep_map, 1, _RET_IP_);
sem               310 drivers/tty/tty_ldsem.c 	lock_acquired(&sem->dep_map, _RET_IP_);
sem               314 drivers/tty/tty_ldsem.c static int __ldsem_down_write_nested(struct ld_semaphore *sem,
sem               319 drivers/tty/tty_ldsem.c 	rwsem_acquire(&sem->dep_map, subclass, 0, _RET_IP_);
sem               321 drivers/tty/tty_ldsem.c 	count = atomic_long_add_return(LDSEM_WRITE_BIAS, &sem->count);
sem               323 drivers/tty/tty_ldsem.c 		lock_contended(&sem->dep_map, _RET_IP_);
sem               324 drivers/tty/tty_ldsem.c 		if (!down_write_failed(sem, count, timeout)) {
sem               325 drivers/tty/tty_ldsem.c 			rwsem_release(&sem->dep_map, 1, _RET_IP_);
sem               329 drivers/tty/tty_ldsem.c 	lock_acquired(&sem->dep_map, _RET_IP_);
sem               337 drivers/tty/tty_ldsem.c int __sched ldsem_down_read(struct ld_semaphore *sem, long timeout)
sem               340 drivers/tty/tty_ldsem.c 	return __ldsem_down_read_nested(sem, 0, timeout);
sem               346 drivers/tty/tty_ldsem.c int ldsem_down_read_trylock(struct ld_semaphore *sem)
sem               348 drivers/tty/tty_ldsem.c 	long count = atomic_long_read(&sem->count);
sem               351 drivers/tty/tty_ldsem.c 		if (atomic_long_try_cmpxchg(&sem->count, &count, count + LDSEM_READ_BIAS)) {
sem               352 drivers/tty/tty_ldsem.c 			rwsem_acquire_read(&sem->dep_map, 0, 1, _RET_IP_);
sem               353 drivers/tty/tty_ldsem.c 			lock_acquired(&sem->dep_map, _RET_IP_);
sem               363 drivers/tty/tty_ldsem.c int __sched ldsem_down_write(struct ld_semaphore *sem, long timeout)
sem               366 drivers/tty/tty_ldsem.c 	return __ldsem_down_write_nested(sem, 0, timeout);
sem               372 drivers/tty/tty_ldsem.c int ldsem_down_write_trylock(struct ld_semaphore *sem)
sem               374 drivers/tty/tty_ldsem.c 	long count = atomic_long_read(&sem->count);
sem               377 drivers/tty/tty_ldsem.c 		if (atomic_long_try_cmpxchg(&sem->count, &count, count + LDSEM_WRITE_BIAS)) {
sem               378 drivers/tty/tty_ldsem.c 			rwsem_acquire(&sem->dep_map, 0, 1, _RET_IP_);
sem               379 drivers/tty/tty_ldsem.c 			lock_acquired(&sem->dep_map, _RET_IP_);
sem               389 drivers/tty/tty_ldsem.c void ldsem_up_read(struct ld_semaphore *sem)
sem               393 drivers/tty/tty_ldsem.c 	rwsem_release(&sem->dep_map, 1, _RET_IP_);
sem               395 drivers/tty/tty_ldsem.c 	count = atomic_long_add_return(-LDSEM_READ_BIAS, &sem->count);
sem               397 drivers/tty/tty_ldsem.c 		ldsem_wake(sem);
sem               403 drivers/tty/tty_ldsem.c void ldsem_up_write(struct ld_semaphore *sem)
sem               407 drivers/tty/tty_ldsem.c 	rwsem_release(&sem->dep_map, 1, _RET_IP_);
sem               409 drivers/tty/tty_ldsem.c 	count = atomic_long_add_return(-LDSEM_WRITE_BIAS, &sem->count);
sem               411 drivers/tty/tty_ldsem.c 		ldsem_wake(sem);
sem               417 drivers/tty/tty_ldsem.c int ldsem_down_read_nested(struct ld_semaphore *sem, int subclass, long timeout)
sem               420 drivers/tty/tty_ldsem.c 	return __ldsem_down_read_nested(sem, subclass, timeout);
sem               423 drivers/tty/tty_ldsem.c int ldsem_down_write_nested(struct ld_semaphore *sem, int subclass,
sem               427 drivers/tty/tty_ldsem.c 	return __ldsem_down_write_nested(sem, subclass, timeout);
sem               174 fs/cifs/cifsproto.h extern void cifs_down_write(struct rw_semaphore *sem);
sem              3134 fs/cifs/connect.c 	down_read(&key->sem);
sem              3210 fs/cifs/connect.c 	up_read(&key->sem);
sem               285 fs/cifs/file.c cifs_down_write(struct rw_semaphore *sem)
sem               287 fs/cifs/file.c 	while (!down_write_trylock(sem))
sem               450 fs/crypto/keyring.c 		down_write(&key->sem);
sem               452 fs/crypto/keyring.c 		up_write(&key->sem);
sem               791 fs/crypto/keyring.c 	down_write(&key->sem);
sem               800 fs/crypto/keyring.c 			up_write(&key->sem);
sem               812 fs/crypto/keyring.c 			up_write(&key->sem);
sem               825 fs/crypto/keyring.c 	up_write(&key->sem);
sem               922 fs/crypto/keyring.c 	down_read(&key->sem);
sem               947 fs/crypto/keyring.c 	up_read(&key->sem);
sem               112 fs/crypto/keysetup_v1.c 	down_read(&key->sem);
sem               139 fs/crypto/keysetup_v1.c 	up_read(&key->sem);
sem               337 fs/crypto/keysetup_v1.c 	up_read(&key->sem);
sem               513 fs/ecryptfs/keystore.c 		down_write(&(walker->global_auth_tok_key->sem));
sem               526 fs/ecryptfs/keystore.c 	up_write(&(walker->global_auth_tok_key->sem));
sem               846 fs/ecryptfs/keystore.c 		up_write(&(auth_tok_key->sem));
sem              1088 fs/ecryptfs/keystore.c 		up_write(&(auth_tok_key->sem));
sem              1625 fs/ecryptfs/keystore.c 	down_write(&(*auth_tok_key)->sem);
sem              1628 fs/ecryptfs/keystore.c 		up_write(&(*auth_tok_key)->sem);
sem              1901 fs/ecryptfs/keystore.c 		up_write(&(auth_tok_key->sem));
sem              1909 fs/ecryptfs/keystore.c 		up_write(&(auth_tok_key->sem));
sem              1914 fs/ecryptfs/keystore.c 		up_write(&(auth_tok_key->sem));
sem              1976 fs/ecryptfs/keystore.c 	up_write(&(auth_tok_key->sem));
sem              2040 fs/ecryptfs/keystore.c 		up_write(&(auth_tok_key->sem));
sem              2438 fs/ecryptfs/keystore.c 			up_write(&(auth_tok_key->sem));
sem              2467 fs/ecryptfs/keystore.c 			up_write(&(auth_tok_key->sem));
sem               205 fs/ecryptfs/main.c 			up_write(&(global_auth_tok->global_auth_tok_key)->sem);
sem                69 fs/jffs2/debug.c 	mutex_lock(&f->sem);
sem                71 fs/jffs2/debug.c 	mutex_unlock(&f->sem);
sem               697 fs/jffs2/debug.c 	mutex_lock(&f->sem);
sem               699 fs/jffs2/debug.c 	mutex_unlock(&f->sem);
sem                94 fs/jffs2/dir.c 	mutex_lock(&dir_f->sem);
sem               107 fs/jffs2/dir.c 	mutex_unlock(&dir_f->sem);
sem               132 fs/jffs2/dir.c 	mutex_lock(&f->sem);
sem               153 fs/jffs2/dir.c 	mutex_unlock(&f->sem);
sem               198 fs/jffs2/dir.c 	mutex_unlock(&f->sem);
sem               267 fs/jffs2/dir.c 		mutex_lock(&f->sem);
sem               269 fs/jffs2/dir.c 		mutex_unlock(&f->sem);
sem               343 fs/jffs2/dir.c 		mutex_unlock(&f->sem);
sem               353 fs/jffs2/dir.c 		mutex_unlock(&f->sem);
sem               367 fs/jffs2/dir.c 	mutex_unlock(&f->sem);
sem               393 fs/jffs2/dir.c 	mutex_lock(&dir_f->sem);
sem               416 fs/jffs2/dir.c 		mutex_unlock(&dir_f->sem);
sem               429 fs/jffs2/dir.c 	mutex_unlock(&dir_f->sem);
sem               501 fs/jffs2/dir.c 		mutex_unlock(&f->sem);
sem               510 fs/jffs2/dir.c 	mutex_unlock(&f->sem);
sem               536 fs/jffs2/dir.c 	mutex_lock(&dir_f->sem);
sem               559 fs/jffs2/dir.c 		mutex_unlock(&dir_f->sem);
sem               573 fs/jffs2/dir.c 	mutex_unlock(&dir_f->sem);
sem               670 fs/jffs2/dir.c 		mutex_unlock(&f->sem);
sem               679 fs/jffs2/dir.c 	mutex_unlock(&f->sem);
sem               705 fs/jffs2/dir.c 	mutex_lock(&dir_f->sem);
sem               731 fs/jffs2/dir.c 		mutex_unlock(&dir_f->sem);
sem               744 fs/jffs2/dir.c 	mutex_unlock(&dir_f->sem);
sem               778 fs/jffs2/dir.c 			mutex_lock(&victim_f->sem);
sem               781 fs/jffs2/dir.c 					mutex_unlock(&victim_f->sem);
sem               785 fs/jffs2/dir.c 			mutex_unlock(&victim_f->sem);
sem               817 fs/jffs2/dir.c 			mutex_lock(&victim_f->sem);
sem               822 fs/jffs2/dir.c 			mutex_unlock(&victim_f->sem);
sem               840 fs/jffs2/dir.c 		mutex_lock(&f->sem);
sem               844 fs/jffs2/dir.c 		mutex_unlock(&f->sem);
sem               125 fs/jffs2/file.c 	mutex_lock(&f->sem);
sem               127 fs/jffs2/file.c 	mutex_unlock(&f->sem);
sem               164 fs/jffs2/file.c 		mutex_lock(&f->sem);
sem               191 fs/jffs2/file.c 			mutex_unlock(&f->sem);
sem               206 fs/jffs2/file.c 			mutex_unlock(&f->sem);
sem               211 fs/jffs2/file.c 		mutex_unlock(&f->sem);
sem               220 fs/jffs2/file.c 		mutex_lock(&f->sem);
sem               222 fs/jffs2/file.c 		mutex_unlock(&f->sem);
sem                60 fs/jffs2/fs.c  		mutex_lock(&f->sem);
sem                64 fs/jffs2/fs.c  			mutex_unlock(&f->sem);
sem                69 fs/jffs2/fs.c  			mutex_unlock(&f->sem);
sem                73 fs/jffs2/fs.c  		mutex_unlock(&f->sem);
sem                93 fs/jffs2/fs.c  	mutex_lock(&f->sem);
sem               146 fs/jffs2/fs.c  		mutex_unlock(&f->sem);
sem               177 fs/jffs2/fs.c  	mutex_unlock(&f->sem);
sem               274 fs/jffs2/fs.c  	mutex_lock(&f->sem);
sem               357 fs/jffs2/fs.c  	mutex_unlock(&f->sem);
sem               366 fs/jffs2/fs.c  	mutex_unlock(&f->sem);
sem               442 fs/jffs2/fs.c  	mutex_lock(&f->sem);
sem               460 fs/jffs2/fs.c  		mutex_unlock(&f->sem);
sem               467 fs/jffs2/fs.c  		mutex_unlock(&f->sem);
sem               484 fs/jffs2/fs.c  		mutex_unlock(&f->sem);
sem               506 fs/jffs2/gc.c  	mutex_lock(&f->sem);
sem               586 fs/jffs2/gc.c  	mutex_unlock(&f->sem);
sem              1328 fs/jffs2/gc.c  	mutex_unlock(&f->sem);
sem              1334 fs/jffs2/gc.c  		mutex_lock(&f->sem);
sem              1339 fs/jffs2/gc.c  	mutex_lock(&f->sem);
sem                27 fs/jffs2/jffs2_fs_i.h 	struct mutex sem;
sem              1385 fs/jffs2/readinode.c 	mutex_init(&f->sem);
sem              1386 fs/jffs2/readinode.c 	mutex_lock(&f->sem);
sem              1390 fs/jffs2/readinode.c 	mutex_unlock(&f->sem);
sem              1403 fs/jffs2/readinode.c 	mutex_lock(&f->sem);
sem              1430 fs/jffs2/readinode.c 	mutex_unlock(&f->sem);
sem                60 fs/jffs2/super.c 	mutex_init(&f->sem);
sem               145 fs/jffs2/write.c 				mutex_unlock(&f->sem);
sem               150 fs/jffs2/write.c 				mutex_lock(&f->sem);
sem               297 fs/jffs2/write.c 				mutex_unlock(&f->sem);
sem               302 fs/jffs2/write.c 				mutex_lock(&f->sem);
sem               368 fs/jffs2/write.c 		mutex_lock(&f->sem);
sem               397 fs/jffs2/write.c 			mutex_unlock(&f->sem);
sem               420 fs/jffs2/write.c 			mutex_unlock(&f->sem);
sem               424 fs/jffs2/write.c 		mutex_unlock(&f->sem);
sem               460 fs/jffs2/write.c 	mutex_lock(&f->sem);
sem               473 fs/jffs2/write.c 		mutex_unlock(&f->sem);
sem               482 fs/jffs2/write.c 	mutex_unlock(&f->sem);
sem               508 fs/jffs2/write.c 	mutex_lock(&dir_f->sem);
sem               532 fs/jffs2/write.c 		mutex_unlock(&dir_f->sem);
sem               541 fs/jffs2/write.c 	mutex_unlock(&dir_f->sem);
sem               570 fs/jffs2/write.c 		mutex_lock(&dir_f->sem);
sem               593 fs/jffs2/write.c 			mutex_unlock(&dir_f->sem);
sem               599 fs/jffs2/write.c 		mutex_unlock(&dir_f->sem);
sem               607 fs/jffs2/write.c 		mutex_lock(&dir_f->sem);
sem               626 fs/jffs2/write.c 		mutex_unlock(&dir_f->sem);
sem               634 fs/jffs2/write.c 		mutex_lock(&dead_f->sem);
sem               660 fs/jffs2/write.c 		mutex_unlock(&dead_f->sem);
sem               687 fs/jffs2/write.c 	mutex_lock(&dir_f->sem);
sem               712 fs/jffs2/write.c 		mutex_unlock(&dir_f->sem);
sem               720 fs/jffs2/write.c 	mutex_unlock(&dir_f->sem);
sem               832 fs/reiserfs/reiserfs.h reiserfs_down_read_safe(struct rw_semaphore *sem, struct super_block *s)
sem               836 fs/reiserfs/reiserfs.h        down_read(sem);
sem               302 fs/ubifs/auth.c 	down_read(&keyring_key->sem);
sem               367 fs/ubifs/auth.c 	up_read(&keyring_key->sem);
sem               179 include/linux/key.h 	struct rw_semaphore	sem;		/* change vs change sem */
sem               462 include/linux/key.h 				   rwsem_is_locked(&((struct key *)(KEY))->sem)))
sem               299 include/linux/mlx5/driver.h 	struct semaphore sem;
sem                36 include/linux/percpu-rwsem.h static inline void percpu_down_read(struct percpu_rw_semaphore *sem)
sem                40 include/linux/percpu-rwsem.h 	rwsem_acquire_read(&sem->rw_sem.dep_map, 0, 0, _RET_IP_);
sem                51 include/linux/percpu-rwsem.h 	__this_cpu_inc(*sem->read_count);
sem                52 include/linux/percpu-rwsem.h 	if (unlikely(!rcu_sync_is_idle(&sem->rss)))
sem                53 include/linux/percpu-rwsem.h 		__percpu_down_read(sem, false); /* Unconditional memory barrier */
sem                61 include/linux/percpu-rwsem.h static inline int percpu_down_read_trylock(struct percpu_rw_semaphore *sem)
sem                69 include/linux/percpu-rwsem.h 	__this_cpu_inc(*sem->read_count);
sem                70 include/linux/percpu-rwsem.h 	if (unlikely(!rcu_sync_is_idle(&sem->rss)))
sem                71 include/linux/percpu-rwsem.h 		ret = __percpu_down_read(sem, true); /* Unconditional memory barrier */
sem                79 include/linux/percpu-rwsem.h 		rwsem_acquire_read(&sem->rw_sem.dep_map, 0, 1, _RET_IP_);
sem                84 include/linux/percpu-rwsem.h static inline void percpu_up_read(struct percpu_rw_semaphore *sem)
sem                90 include/linux/percpu-rwsem.h 	if (likely(rcu_sync_is_idle(&sem->rss)))
sem                91 include/linux/percpu-rwsem.h 		__this_cpu_dec(*sem->read_count);
sem                93 include/linux/percpu-rwsem.h 		__percpu_up_read(sem); /* Unconditional memory barrier */
sem                96 include/linux/percpu-rwsem.h 	rwsem_release(&sem->rw_sem.dep_map, 1, _RET_IP_);
sem               107 include/linux/percpu-rwsem.h #define percpu_init_rwsem(sem)					\
sem               110 include/linux/percpu-rwsem.h 	__percpu_init_rwsem(sem, #sem, &rwsem_key);		\
sem               113 include/linux/percpu-rwsem.h #define percpu_rwsem_is_held(sem) lockdep_is_held(&(sem)->rw_sem)
sem               115 include/linux/percpu-rwsem.h #define percpu_rwsem_assert_held(sem)				\
sem               116 include/linux/percpu-rwsem.h 	lockdep_assert_held(&(sem)->rw_sem)
sem               118 include/linux/percpu-rwsem.h static inline void percpu_rwsem_release(struct percpu_rw_semaphore *sem,
sem               121 include/linux/percpu-rwsem.h 	lock_release(&sem->rw_sem.dep_map, 1, ip);
sem               124 include/linux/percpu-rwsem.h 		atomic_long_set(&sem->rw_sem.owner, RWSEM_OWNER_UNKNOWN);
sem               128 include/linux/percpu-rwsem.h static inline void percpu_rwsem_acquire(struct percpu_rw_semaphore *sem,
sem               131 include/linux/percpu-rwsem.h 	lock_acquire(&sem->rw_sem.dep_map, 0, 1, read, 1, NULL, ip);
sem               134 include/linux/percpu-rwsem.h 		atomic_long_set(&sem->rw_sem.owner, (long)current);
sem                63 include/linux/rwsem.h static inline int rwsem_is_locked(struct rw_semaphore *sem)
sem                65 include/linux/rwsem.h 	return atomic_long_read(&sem->count) != 0;
sem               103 include/linux/rwsem.h extern void __init_rwsem(struct rw_semaphore *sem, const char *name,
sem               106 include/linux/rwsem.h #define init_rwsem(sem)						\
sem               110 include/linux/rwsem.h 	__init_rwsem((sem), #sem, &__key);			\
sem               119 include/linux/rwsem.h static inline int rwsem_is_contended(struct rw_semaphore *sem)
sem               121 include/linux/rwsem.h 	return !list_empty(&sem->wait_list);
sem               127 include/linux/rwsem.h extern void down_read(struct rw_semaphore *sem);
sem               128 include/linux/rwsem.h extern int __must_check down_read_killable(struct rw_semaphore *sem);
sem               133 include/linux/rwsem.h extern int down_read_trylock(struct rw_semaphore *sem);
sem               138 include/linux/rwsem.h extern void down_write(struct rw_semaphore *sem);
sem               139 include/linux/rwsem.h extern int __must_check down_write_killable(struct rw_semaphore *sem);
sem               144 include/linux/rwsem.h extern int down_write_trylock(struct rw_semaphore *sem);
sem               149 include/linux/rwsem.h extern void up_read(struct rw_semaphore *sem);
sem               154 include/linux/rwsem.h extern void up_write(struct rw_semaphore *sem);
sem               159 include/linux/rwsem.h extern void downgrade_write(struct rw_semaphore *sem);
sem               175 include/linux/rwsem.h extern void down_read_nested(struct rw_semaphore *sem, int subclass);
sem               176 include/linux/rwsem.h extern void down_write_nested(struct rw_semaphore *sem, int subclass);
sem               177 include/linux/rwsem.h extern int down_write_killable_nested(struct rw_semaphore *sem, int subclass);
sem               178 include/linux/rwsem.h extern void _down_write_nest_lock(struct rw_semaphore *sem, struct lockdep_map *nest_lock);
sem               180 include/linux/rwsem.h # define down_write_nest_lock(sem, nest_lock)			\
sem               183 include/linux/rwsem.h 	_down_write_nest_lock(sem, &(nest_lock)->dep_map);	\
sem               192 include/linux/rwsem.h extern void down_read_non_owner(struct rw_semaphore *sem);
sem               193 include/linux/rwsem.h extern void up_read_non_owner(struct rw_semaphore *sem);
sem               195 include/linux/rwsem.h # define down_read_nested(sem, subclass)		down_read(sem)
sem               196 include/linux/rwsem.h # define down_write_nest_lock(sem, nest_lock)	down_write(sem)
sem               197 include/linux/rwsem.h # define down_write_nested(sem, subclass)	down_write(sem)
sem               198 include/linux/rwsem.h # define down_write_killable_nested(sem, subclass)	down_write_killable(sem)
sem               199 include/linux/rwsem.h # define down_read_non_owner(sem)		down_read(sem)
sem               200 include/linux/rwsem.h # define up_read_non_owner(sem)			up_read(sem)
sem                31 include/linux/semaphore.h static inline void sema_init(struct semaphore *sem, int val)
sem                34 include/linux/semaphore.h 	*sem = (struct semaphore) __SEMAPHORE_INITIALIZER(*sem, val);
sem                35 include/linux/semaphore.h 	lockdep_init_map(&sem->lock.dep_map, "semaphore->lock", &__key, 0);
sem                38 include/linux/semaphore.h extern void down(struct semaphore *sem);
sem                39 include/linux/semaphore.h extern int __must_check down_interruptible(struct semaphore *sem);
sem                40 include/linux/semaphore.h extern int __must_check down_killable(struct semaphore *sem);
sem                41 include/linux/semaphore.h extern int __must_check down_trylock(struct semaphore *sem);
sem                42 include/linux/semaphore.h extern int __must_check down_timeout(struct semaphore *sem, long jiffies);
sem                43 include/linux/semaphore.h extern void up(struct semaphore *sem);
sem               144 include/linux/tty_ldisc.h extern void __init_ldsem(struct ld_semaphore *sem, const char *name,
sem               147 include/linux/tty_ldisc.h #define init_ldsem(sem)						\
sem               151 include/linux/tty_ldisc.h 	__init_ldsem((sem), #sem, &__key);			\
sem               155 include/linux/tty_ldisc.h extern int ldsem_down_read(struct ld_semaphore *sem, long timeout);
sem               156 include/linux/tty_ldisc.h extern int ldsem_down_read_trylock(struct ld_semaphore *sem);
sem               157 include/linux/tty_ldisc.h extern int ldsem_down_write(struct ld_semaphore *sem, long timeout);
sem               158 include/linux/tty_ldisc.h extern int ldsem_down_write_trylock(struct ld_semaphore *sem);
sem               159 include/linux/tty_ldisc.h extern void ldsem_up_read(struct ld_semaphore *sem);
sem               160 include/linux/tty_ldisc.h extern void ldsem_up_write(struct ld_semaphore *sem);
sem               163 include/linux/tty_ldisc.h extern int ldsem_down_read_nested(struct ld_semaphore *sem, int subclass,
sem               165 include/linux/tty_ldisc.h extern int ldsem_down_write_nested(struct ld_semaphore *sem, int subclass,
sem               168 include/linux/tty_ldisc.h # define ldsem_down_read_nested(sem, subclass, timeout)		\
sem               169 include/linux/tty_ldisc.h 		ldsem_down_read(sem, timeout)
sem               170 include/linux/tty_ldisc.h # define ldsem_down_write_nested(sem, subclass, timeout)	\
sem               171 include/linux/tty_ldisc.h 		ldsem_down_write(sem, timeout)
sem                66 include/soc/arc/mcip.h 			     msg:1, sem:1, ipi:1, slv:1,
sem                70 include/soc/arc/mcip.h 			     slv:1, ipi:1, sem:1, msg:1,
sem                29 include/uapi/linux/sem.h 	struct sem	*sem_base;		/* ptr to first semaphore in array */
sem               126 ipc/sem.c      	struct sem		sems[];
sem               271 ipc/sem.c      		struct sem *curr;
sem               292 ipc/sem.c      		struct sem *sem = &sma->sems[i];
sem               294 ipc/sem.c      		list_splice_init(&sem->pending_alter, &sma->pending_alter);
sem               314 ipc/sem.c      	struct sem *sem;
sem               328 ipc/sem.c      		sem = &sma->sems[i];
sem               329 ipc/sem.c      		spin_lock(&sem->lock);
sem               330 ipc/sem.c      		spin_unlock(&sem->lock);
sem               370 ipc/sem.c      	struct sem *sem;
sem               390 ipc/sem.c      	sem = &sma->sems[idx];
sem               401 ipc/sem.c      		spin_lock(&sem->lock);
sem               408 ipc/sem.c      		spin_unlock(&sem->lock);
sem               424 ipc/sem.c      		spin_lock(&sem->lock);
sem               445 ipc/sem.c      		struct sem *sem = &sma->sems[locknum];
sem               446 ipc/sem.c      		spin_unlock(&sem->lock);
sem               630 ipc/sem.c      	struct sem *curr;
sem               702 ipc/sem.c      	struct sem *curr;
sem              1154 ipc/sem.c      		struct sem *sem = &sma->sems[i];
sem              1155 ipc/sem.c      		list_for_each_entry_safe(q, tq, &sem->pending_const, list) {
sem              1159 ipc/sem.c      		list_for_each_entry_safe(q, tq, &sem->pending_alter, list) {
sem              1163 ipc/sem.c      		ipc_update_pid(&sem->sempid, NULL);
sem              1329 ipc/sem.c      	struct sem *curr;
sem              1390 ipc/sem.c      	struct sem *curr;
sem              2122 ipc/sem.c      		struct sem *curr;
sem              2377 ipc/sem.c      			struct sem *semaphore = &sma->sems[i];
sem                36 kernel/bpf/stackmap.c 	struct rw_semaphore *sem;
sem                44 kernel/bpf/stackmap.c 	up_read_non_owner(work->sem);
sem                45 kernel/bpf/stackmap.c 	work->sem = NULL;
sem               335 kernel/bpf/stackmap.c 		work->sem = &current->mm->mmap_sem;
sem                13 kernel/locking/percpu-rwsem.c int __percpu_init_rwsem(struct percpu_rw_semaphore *sem,
sem                16 kernel/locking/percpu-rwsem.c 	sem->read_count = alloc_percpu(int);
sem                17 kernel/locking/percpu-rwsem.c 	if (unlikely(!sem->read_count))
sem                21 kernel/locking/percpu-rwsem.c 	rcu_sync_init(&sem->rss);
sem                22 kernel/locking/percpu-rwsem.c 	__init_rwsem(&sem->rw_sem, name, rwsem_key);
sem                23 kernel/locking/percpu-rwsem.c 	rcuwait_init(&sem->writer);
sem                24 kernel/locking/percpu-rwsem.c 	sem->readers_block = 0;
sem                29 kernel/locking/percpu-rwsem.c void percpu_free_rwsem(struct percpu_rw_semaphore *sem)
sem                35 kernel/locking/percpu-rwsem.c 	if (!sem->read_count)
sem                38 kernel/locking/percpu-rwsem.c 	rcu_sync_dtor(&sem->rss);
sem                39 kernel/locking/percpu-rwsem.c 	free_percpu(sem->read_count);
sem                40 kernel/locking/percpu-rwsem.c 	sem->read_count = NULL; /* catch use after free bugs */
sem                44 kernel/locking/percpu-rwsem.c int __percpu_down_read(struct percpu_rw_semaphore *sem, int try)
sem                67 kernel/locking/percpu-rwsem.c 	if (likely(!smp_load_acquire(&sem->readers_block)))
sem                74 kernel/locking/percpu-rwsem.c 	__percpu_up_read(sem);
sem                88 kernel/locking/percpu-rwsem.c 	__down_read(&sem->rw_sem);
sem                89 kernel/locking/percpu-rwsem.c 	this_cpu_inc(*sem->read_count);
sem                90 kernel/locking/percpu-rwsem.c 	__up_read(&sem->rw_sem);
sem                97 kernel/locking/percpu-rwsem.c void __percpu_up_read(struct percpu_rw_semaphore *sem)
sem               105 kernel/locking/percpu-rwsem.c 	__this_cpu_dec(*sem->read_count);
sem               108 kernel/locking/percpu-rwsem.c 	rcuwait_wake_up(&sem->writer);
sem               128 kernel/locking/percpu-rwsem.c static bool readers_active_check(struct percpu_rw_semaphore *sem)
sem               130 kernel/locking/percpu-rwsem.c 	if (per_cpu_sum(*sem->read_count) != 0)
sem               143 kernel/locking/percpu-rwsem.c void percpu_down_write(struct percpu_rw_semaphore *sem)
sem               146 kernel/locking/percpu-rwsem.c 	rcu_sync_enter(&sem->rss);
sem               148 kernel/locking/percpu-rwsem.c 	down_write(&sem->rw_sem);
sem               154 kernel/locking/percpu-rwsem.c 	WRITE_ONCE(sem->readers_block, 1);
sem               165 kernel/locking/percpu-rwsem.c 	rcuwait_wait_event(&sem->writer, readers_active_check(sem));
sem               169 kernel/locking/percpu-rwsem.c void percpu_up_write(struct percpu_rw_semaphore *sem)
sem               181 kernel/locking/percpu-rwsem.c 	smp_store_release(&sem->readers_block, 0);
sem               186 kernel/locking/percpu-rwsem.c 	up_write(&sem->rw_sem);
sem               193 kernel/locking/percpu-rwsem.c 	rcu_sync_exit(&sem->rss);
sem               106 kernel/locking/rwsem.c # define DEBUG_RWSEMS_WARN_ON(c, sem)	do {			\
sem               109 kernel/locking/rwsem.c 		#c, atomic_long_read(&(sem)->count),		\
sem               110 kernel/locking/rwsem.c 		(unsigned long) sem->magic,			\
sem               111 kernel/locking/rwsem.c 		atomic_long_read(&(sem)->owner), (long)current,	\
sem               112 kernel/locking/rwsem.c 		list_empty(&(sem)->wait_list) ? "" : "not "))	\
sem               116 kernel/locking/rwsem.c # define DEBUG_RWSEMS_WARN_ON(c, sem)
sem               175 kernel/locking/rwsem.c static inline void rwsem_set_owner(struct rw_semaphore *sem)
sem               177 kernel/locking/rwsem.c 	atomic_long_set(&sem->owner, (long)current);
sem               180 kernel/locking/rwsem.c static inline void rwsem_clear_owner(struct rw_semaphore *sem)
sem               182 kernel/locking/rwsem.c 	atomic_long_set(&sem->owner, 0);
sem               188 kernel/locking/rwsem.c static inline bool rwsem_test_oflags(struct rw_semaphore *sem, long flags)
sem               190 kernel/locking/rwsem.c 	return atomic_long_read(&sem->owner) & flags;
sem               203 kernel/locking/rwsem.c static inline void __rwsem_set_reader_owned(struct rw_semaphore *sem,
sem               207 kernel/locking/rwsem.c 		(atomic_long_read(&sem->owner) & RWSEM_RD_NONSPINNABLE);
sem               209 kernel/locking/rwsem.c 	atomic_long_set(&sem->owner, val);
sem               212 kernel/locking/rwsem.c static inline void rwsem_set_reader_owned(struct rw_semaphore *sem)
sem               214 kernel/locking/rwsem.c 	__rwsem_set_reader_owned(sem, current);
sem               220 kernel/locking/rwsem.c static inline bool is_rwsem_reader_owned(struct rw_semaphore *sem)
sem               226 kernel/locking/rwsem.c 	long count = atomic_long_read(&sem->count);
sem               231 kernel/locking/rwsem.c 	return rwsem_test_oflags(sem, RWSEM_READER_OWNED);
sem               241 kernel/locking/rwsem.c static inline void rwsem_clear_reader_owned(struct rw_semaphore *sem)
sem               243 kernel/locking/rwsem.c 	unsigned long val = atomic_long_read(&sem->owner);
sem               246 kernel/locking/rwsem.c 		if (atomic_long_try_cmpxchg(&sem->owner, &val,
sem               252 kernel/locking/rwsem.c static inline void rwsem_clear_reader_owned(struct rw_semaphore *sem)
sem               261 kernel/locking/rwsem.c static inline void rwsem_set_nonspinnable(struct rw_semaphore *sem)
sem               263 kernel/locking/rwsem.c 	unsigned long owner = atomic_long_read(&sem->owner);
sem               270 kernel/locking/rwsem.c 	} while (!atomic_long_try_cmpxchg(&sem->owner, &owner,
sem               274 kernel/locking/rwsem.c static inline bool rwsem_read_trylock(struct rw_semaphore *sem)
sem               276 kernel/locking/rwsem.c 	long cnt = atomic_long_add_return_acquire(RWSEM_READER_BIAS, &sem->count);
sem               278 kernel/locking/rwsem.c 		rwsem_set_nonspinnable(sem);
sem               285 kernel/locking/rwsem.c static inline struct task_struct *rwsem_owner(struct rw_semaphore *sem)
sem               288 kernel/locking/rwsem.c 		(atomic_long_read(&sem->owner) & ~RWSEM_OWNER_FLAGS_MASK);
sem               296 kernel/locking/rwsem.c rwsem_owner_flags(struct rw_semaphore *sem, unsigned long *pflags)
sem               298 kernel/locking/rwsem.c 	unsigned long owner = atomic_long_read(&sem->owner);
sem               324 kernel/locking/rwsem.c void __init_rwsem(struct rw_semaphore *sem, const char *name,
sem               331 kernel/locking/rwsem.c 	debug_check_no_locks_freed((void *)sem, sizeof(*sem));
sem               332 kernel/locking/rwsem.c 	lockdep_init_map(&sem->dep_map, name, key, 0);
sem               335 kernel/locking/rwsem.c 	sem->magic = sem;
sem               337 kernel/locking/rwsem.c 	atomic_long_set(&sem->count, RWSEM_UNLOCKED_VALUE);
sem               338 kernel/locking/rwsem.c 	raw_spin_lock_init(&sem->wait_lock);
sem               339 kernel/locking/rwsem.c 	INIT_LIST_HEAD(&sem->wait_list);
sem               340 kernel/locking/rwsem.c 	atomic_long_set(&sem->owner, 0L);
sem               342 kernel/locking/rwsem.c 	osq_lock_init(&sem->osq);
sem               359 kernel/locking/rwsem.c #define rwsem_first_waiter(sem) \
sem               360 kernel/locking/rwsem.c 	list_first_entry(&sem->wait_list, struct rwsem_waiter, list)
sem               401 kernel/locking/rwsem.c static void rwsem_mark_wake(struct rw_semaphore *sem,
sem               409 kernel/locking/rwsem.c 	lockdep_assert_held(&sem->wait_lock);
sem               415 kernel/locking/rwsem.c 	waiter = rwsem_first_waiter(sem);
sem               436 kernel/locking/rwsem.c 	if (unlikely(atomic_long_read(&sem->count) < 0))
sem               448 kernel/locking/rwsem.c 		oldcount = atomic_long_fetch_add(adjustment, &sem->count);
sem               461 kernel/locking/rwsem.c 			atomic_long_add(-adjustment, &sem->count);
sem               475 kernel/locking/rwsem.c 		__rwsem_set_reader_owned(sem, owner);
sem               502 kernel/locking/rwsem.c 	list_for_each_entry_safe(waiter, tmp, &sem->wait_list, list) {
sem               518 kernel/locking/rwsem.c 	if (list_empty(&sem->wait_list)) {
sem               527 kernel/locking/rwsem.c 	if (woken && (atomic_long_read(&sem->count) & RWSEM_FLAG_HANDOFF))
sem               531 kernel/locking/rwsem.c 		atomic_long_add(adjustment, &sem->count);
sem               563 kernel/locking/rwsem.c static inline bool rwsem_try_write_lock(struct rw_semaphore *sem,
sem               568 kernel/locking/rwsem.c 	lockdep_assert_held(&sem->wait_lock);
sem               570 kernel/locking/rwsem.c 	count = atomic_long_read(&sem->count);
sem               588 kernel/locking/rwsem.c 			if (list_is_singular(&sem->wait_list))
sem               591 kernel/locking/rwsem.c 	} while (!atomic_long_try_cmpxchg_acquire(&sem->count, &count, new));
sem               600 kernel/locking/rwsem.c 	rwsem_set_owner(sem);
sem               610 kernel/locking/rwsem.c static inline bool rwsem_try_read_lock_unqueued(struct rw_semaphore *sem)
sem               612 kernel/locking/rwsem.c 	long count = atomic_long_read(&sem->count);
sem               617 kernel/locking/rwsem.c 	count = atomic_long_fetch_add_acquire(RWSEM_READER_BIAS, &sem->count);
sem               619 kernel/locking/rwsem.c 		rwsem_set_reader_owned(sem);
sem               625 kernel/locking/rwsem.c 	atomic_long_add(-RWSEM_READER_BIAS, &sem->count);
sem               632 kernel/locking/rwsem.c static inline bool rwsem_try_write_lock_unqueued(struct rw_semaphore *sem)
sem               634 kernel/locking/rwsem.c 	long count = atomic_long_read(&sem->count);
sem               637 kernel/locking/rwsem.c 		if (atomic_long_try_cmpxchg_acquire(&sem->count, &count,
sem               639 kernel/locking/rwsem.c 			rwsem_set_owner(sem);
sem               656 kernel/locking/rwsem.c static inline bool rwsem_can_spin_on_owner(struct rw_semaphore *sem,
sem               672 kernel/locking/rwsem.c 	owner = rwsem_owner_flags(sem, &flags);
sem               718 kernel/locking/rwsem.c rwsem_spin_on_owner(struct rw_semaphore *sem, unsigned long nonspinnable)
sem               724 kernel/locking/rwsem.c 	owner = rwsem_owner_flags(sem, &flags);
sem               737 kernel/locking/rwsem.c 		new = rwsem_owner_flags(sem, &new_flags);
sem               775 kernel/locking/rwsem.c static inline u64 rwsem_rspin_threshold(struct rw_semaphore *sem)
sem               777 kernel/locking/rwsem.c 	long count = atomic_long_read(&sem->count);
sem               788 kernel/locking/rwsem.c static bool rwsem_optimistic_spin(struct rw_semaphore *sem, bool wlock)
sem               800 kernel/locking/rwsem.c 	if (!osq_lock(&sem->osq))
sem               812 kernel/locking/rwsem.c 		owner_state = rwsem_spin_on_owner(sem, nonspinnable);
sem               819 kernel/locking/rwsem.c 		taken = wlock ? rwsem_try_write_lock_unqueued(sem)
sem               820 kernel/locking/rwsem.c 			      : rwsem_try_read_lock_unqueued(sem);
sem               837 kernel/locking/rwsem.c 				if (rwsem_test_oflags(sem, nonspinnable))
sem               839 kernel/locking/rwsem.c 				rspin_threshold = rwsem_rspin_threshold(sem);
sem               851 kernel/locking/rwsem.c 				rwsem_set_nonspinnable(sem);
sem               905 kernel/locking/rwsem.c 	osq_unlock(&sem->osq);
sem               922 kernel/locking/rwsem.c static inline void clear_wr_nonspinnable(struct rw_semaphore *sem)
sem               924 kernel/locking/rwsem.c 	if (rwsem_test_oflags(sem, RWSEM_WR_NONSPINNABLE))
sem               925 kernel/locking/rwsem.c 		atomic_long_andnot(RWSEM_WR_NONSPINNABLE, &sem->owner);
sem               947 kernel/locking/rwsem.c static inline bool rwsem_reader_phase_trylock(struct rw_semaphore *sem,
sem               950 kernel/locking/rwsem.c 	unsigned long owner = atomic_long_read(&sem->owner);
sem               956 kernel/locking/rwsem.c 	    rwsem_try_read_lock_unqueued(sem)) {
sem               964 kernel/locking/rwsem.c static inline bool rwsem_can_spin_on_owner(struct rw_semaphore *sem,
sem               970 kernel/locking/rwsem.c static inline bool rwsem_optimistic_spin(struct rw_semaphore *sem, bool wlock)
sem               975 kernel/locking/rwsem.c static inline void clear_wr_nonspinnable(struct rw_semaphore *sem) { }
sem               977 kernel/locking/rwsem.c static inline bool rwsem_reader_phase_trylock(struct rw_semaphore *sem,
sem               984 kernel/locking/rwsem.c rwsem_spin_on_owner(struct rw_semaphore *sem, unsigned long nonspinnable)
sem               995 kernel/locking/rwsem.c rwsem_down_read_slowpath(struct rw_semaphore *sem, int state)
sem              1006 kernel/locking/rwsem.c 	waiter.last_rowner = atomic_long_read(&sem->owner);
sem              1010 kernel/locking/rwsem.c 	if (!rwsem_can_spin_on_owner(sem, RWSEM_RD_NONSPINNABLE))
sem              1016 kernel/locking/rwsem.c 	atomic_long_add(-RWSEM_READER_BIAS, &sem->count);
sem              1018 kernel/locking/rwsem.c 	if (rwsem_optimistic_spin(sem, false)) {
sem              1024 kernel/locking/rwsem.c 		if ((atomic_long_read(&sem->count) & RWSEM_FLAG_WAITERS)) {
sem              1025 kernel/locking/rwsem.c 			raw_spin_lock_irq(&sem->wait_lock);
sem              1026 kernel/locking/rwsem.c 			if (!list_empty(&sem->wait_list))
sem              1027 kernel/locking/rwsem.c 				rwsem_mark_wake(sem, RWSEM_WAKE_READ_OWNED,
sem              1029 kernel/locking/rwsem.c 			raw_spin_unlock_irq(&sem->wait_lock);
sem              1032 kernel/locking/rwsem.c 		return sem;
sem              1033 kernel/locking/rwsem.c 	} else if (rwsem_reader_phase_trylock(sem, waiter.last_rowner)) {
sem              1035 kernel/locking/rwsem.c 		return sem;
sem              1043 kernel/locking/rwsem.c 	raw_spin_lock_irq(&sem->wait_lock);
sem              1044 kernel/locking/rwsem.c 	if (list_empty(&sem->wait_list)) {
sem              1051 kernel/locking/rwsem.c 		if (adjustment && !(atomic_long_read(&sem->count) &
sem              1055 kernel/locking/rwsem.c 			raw_spin_unlock_irq(&sem->wait_lock);
sem              1056 kernel/locking/rwsem.c 			rwsem_set_reader_owned(sem);
sem              1058 kernel/locking/rwsem.c 			return sem;
sem              1062 kernel/locking/rwsem.c 	list_add_tail(&waiter.list, &sem->wait_list);
sem              1066 kernel/locking/rwsem.c 		count = atomic_long_add_return(adjustment, &sem->count);
sem              1068 kernel/locking/rwsem.c 		count = atomic_long_read(&sem->count);
sem              1077 kernel/locking/rwsem.c 		clear_wr_nonspinnable(sem);
sem              1082 kernel/locking/rwsem.c 		rwsem_mark_wake(sem, RWSEM_WAKE_ANY, &wake_q);
sem              1084 kernel/locking/rwsem.c 	raw_spin_unlock_irq(&sem->wait_lock);
sem              1095 kernel/locking/rwsem.c 			raw_spin_lock_irq(&sem->wait_lock);
sem              1098 kernel/locking/rwsem.c 			raw_spin_unlock_irq(&sem->wait_lock);
sem              1108 kernel/locking/rwsem.c 	return sem;
sem              1112 kernel/locking/rwsem.c 	if (list_empty(&sem->wait_list)) {
sem              1114 kernel/locking/rwsem.c 				   &sem->count);
sem              1116 kernel/locking/rwsem.c 	raw_spin_unlock_irq(&sem->wait_lock);
sem              1126 kernel/locking/rwsem.c static inline void rwsem_disable_reader_optspin(struct rw_semaphore *sem,
sem              1130 kernel/locking/rwsem.c 		atomic_long_or(RWSEM_RD_NONSPINNABLE, &sem->owner);
sem              1139 kernel/locking/rwsem.c rwsem_down_write_slowpath(struct rw_semaphore *sem, int state)
sem              1145 kernel/locking/rwsem.c 	struct rw_semaphore *ret = sem;
sem              1149 kernel/locking/rwsem.c 	if (rwsem_can_spin_on_owner(sem, RWSEM_WR_NONSPINNABLE) &&
sem              1150 kernel/locking/rwsem.c 	    rwsem_optimistic_spin(sem, true)) {
sem              1152 kernel/locking/rwsem.c 		return sem;
sem              1160 kernel/locking/rwsem.c 	disable_rspin = atomic_long_read(&sem->owner) & RWSEM_NONSPINNABLE;
sem              1170 kernel/locking/rwsem.c 	raw_spin_lock_irq(&sem->wait_lock);
sem              1173 kernel/locking/rwsem.c 	wstate = list_empty(&sem->wait_list) ? WRITER_FIRST : WRITER_NOT_FIRST;
sem              1175 kernel/locking/rwsem.c 	list_add_tail(&waiter.list, &sem->wait_list);
sem              1179 kernel/locking/rwsem.c 		count = atomic_long_read(&sem->count);
sem              1192 kernel/locking/rwsem.c 		rwsem_mark_wake(sem, (count & RWSEM_READER_MASK)
sem              1201 kernel/locking/rwsem.c 			raw_spin_unlock_irq(&sem->wait_lock);
sem              1204 kernel/locking/rwsem.c 			raw_spin_lock_irq(&sem->wait_lock);
sem              1207 kernel/locking/rwsem.c 		atomic_long_or(RWSEM_FLAG_WAITERS, &sem->count);
sem              1214 kernel/locking/rwsem.c 		if (rwsem_try_write_lock(sem, wstate)) {
sem              1219 kernel/locking/rwsem.c 		raw_spin_unlock_irq(&sem->wait_lock);
sem              1230 kernel/locking/rwsem.c 		    rwsem_spin_on_owner(sem, RWSEM_NONSPINNABLE) == OWNER_NULL)
sem              1249 kernel/locking/rwsem.c 			    (rwsem_first_waiter(sem) == &waiter))
sem              1252 kernel/locking/rwsem.c 			count = atomic_long_read(&sem->count);
sem              1268 kernel/locking/rwsem.c 		raw_spin_lock_irq(&sem->wait_lock);
sem              1272 kernel/locking/rwsem.c 	rwsem_disable_reader_optspin(sem, disable_rspin);
sem              1273 kernel/locking/rwsem.c 	raw_spin_unlock_irq(&sem->wait_lock);
sem              1280 kernel/locking/rwsem.c 	raw_spin_lock_irq(&sem->wait_lock);
sem              1284 kernel/locking/rwsem.c 		atomic_long_add(-RWSEM_FLAG_HANDOFF,  &sem->count);
sem              1286 kernel/locking/rwsem.c 	if (list_empty(&sem->wait_list))
sem              1287 kernel/locking/rwsem.c 		atomic_long_andnot(RWSEM_FLAG_WAITERS, &sem->count);
sem              1289 kernel/locking/rwsem.c 		rwsem_mark_wake(sem, RWSEM_WAKE_ANY, &wake_q);
sem              1290 kernel/locking/rwsem.c 	raw_spin_unlock_irq(&sem->wait_lock);
sem              1301 kernel/locking/rwsem.c static struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem, long count)
sem              1306 kernel/locking/rwsem.c 	raw_spin_lock_irqsave(&sem->wait_lock, flags);
sem              1308 kernel/locking/rwsem.c 	if (!list_empty(&sem->wait_list))
sem              1309 kernel/locking/rwsem.c 		rwsem_mark_wake(sem, RWSEM_WAKE_ANY, &wake_q);
sem              1311 kernel/locking/rwsem.c 	raw_spin_unlock_irqrestore(&sem->wait_lock, flags);
sem              1314 kernel/locking/rwsem.c 	return sem;
sem              1322 kernel/locking/rwsem.c static struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem)
sem              1327 kernel/locking/rwsem.c 	raw_spin_lock_irqsave(&sem->wait_lock, flags);
sem              1329 kernel/locking/rwsem.c 	if (!list_empty(&sem->wait_list))
sem              1330 kernel/locking/rwsem.c 		rwsem_mark_wake(sem, RWSEM_WAKE_READ_OWNED, &wake_q);
sem              1332 kernel/locking/rwsem.c 	raw_spin_unlock_irqrestore(&sem->wait_lock, flags);
sem              1335 kernel/locking/rwsem.c 	return sem;
sem              1341 kernel/locking/rwsem.c inline void __down_read(struct rw_semaphore *sem)
sem              1343 kernel/locking/rwsem.c 	if (!rwsem_read_trylock(sem)) {
sem              1344 kernel/locking/rwsem.c 		rwsem_down_read_slowpath(sem, TASK_UNINTERRUPTIBLE);
sem              1345 kernel/locking/rwsem.c 		DEBUG_RWSEMS_WARN_ON(!is_rwsem_reader_owned(sem), sem);
sem              1347 kernel/locking/rwsem.c 		rwsem_set_reader_owned(sem);
sem              1351 kernel/locking/rwsem.c static inline int __down_read_killable(struct rw_semaphore *sem)
sem              1353 kernel/locking/rwsem.c 	if (!rwsem_read_trylock(sem)) {
sem              1354 kernel/locking/rwsem.c 		if (IS_ERR(rwsem_down_read_slowpath(sem, TASK_KILLABLE)))
sem              1356 kernel/locking/rwsem.c 		DEBUG_RWSEMS_WARN_ON(!is_rwsem_reader_owned(sem), sem);
sem              1358 kernel/locking/rwsem.c 		rwsem_set_reader_owned(sem);
sem              1363 kernel/locking/rwsem.c static inline int __down_read_trylock(struct rw_semaphore *sem)
sem              1367 kernel/locking/rwsem.c 	DEBUG_RWSEMS_WARN_ON(sem->magic != sem, sem);
sem              1374 kernel/locking/rwsem.c 		if (atomic_long_try_cmpxchg_acquire(&sem->count, &tmp,
sem              1376 kernel/locking/rwsem.c 			rwsem_set_reader_owned(sem);
sem              1386 kernel/locking/rwsem.c static inline void __down_write(struct rw_semaphore *sem)
sem              1390 kernel/locking/rwsem.c 	if (unlikely(!atomic_long_try_cmpxchg_acquire(&sem->count, &tmp,
sem              1392 kernel/locking/rwsem.c 		rwsem_down_write_slowpath(sem, TASK_UNINTERRUPTIBLE);
sem              1394 kernel/locking/rwsem.c 		rwsem_set_owner(sem);
sem              1397 kernel/locking/rwsem.c static inline int __down_write_killable(struct rw_semaphore *sem)
sem              1401 kernel/locking/rwsem.c 	if (unlikely(!atomic_long_try_cmpxchg_acquire(&sem->count, &tmp,
sem              1403 kernel/locking/rwsem.c 		if (IS_ERR(rwsem_down_write_slowpath(sem, TASK_KILLABLE)))
sem              1406 kernel/locking/rwsem.c 		rwsem_set_owner(sem);
sem              1411 kernel/locking/rwsem.c static inline int __down_write_trylock(struct rw_semaphore *sem)
sem              1415 kernel/locking/rwsem.c 	DEBUG_RWSEMS_WARN_ON(sem->magic != sem, sem);
sem              1418 kernel/locking/rwsem.c 	if (atomic_long_try_cmpxchg_acquire(&sem->count, &tmp,
sem              1420 kernel/locking/rwsem.c 		rwsem_set_owner(sem);
sem              1429 kernel/locking/rwsem.c inline void __up_read(struct rw_semaphore *sem)
sem              1433 kernel/locking/rwsem.c 	DEBUG_RWSEMS_WARN_ON(sem->magic != sem, sem);
sem              1434 kernel/locking/rwsem.c 	DEBUG_RWSEMS_WARN_ON(!is_rwsem_reader_owned(sem), sem);
sem              1436 kernel/locking/rwsem.c 	rwsem_clear_reader_owned(sem);
sem              1437 kernel/locking/rwsem.c 	tmp = atomic_long_add_return_release(-RWSEM_READER_BIAS, &sem->count);
sem              1438 kernel/locking/rwsem.c 	DEBUG_RWSEMS_WARN_ON(tmp < 0, sem);
sem              1441 kernel/locking/rwsem.c 		clear_wr_nonspinnable(sem);
sem              1442 kernel/locking/rwsem.c 		rwsem_wake(sem, tmp);
sem              1449 kernel/locking/rwsem.c static inline void __up_write(struct rw_semaphore *sem)
sem              1453 kernel/locking/rwsem.c 	DEBUG_RWSEMS_WARN_ON(sem->magic != sem, sem);
sem              1458 kernel/locking/rwsem.c 	DEBUG_RWSEMS_WARN_ON((rwsem_owner(sem) != current) &&
sem              1459 kernel/locking/rwsem.c 			    !rwsem_test_oflags(sem, RWSEM_NONSPINNABLE), sem);
sem              1461 kernel/locking/rwsem.c 	rwsem_clear_owner(sem);
sem              1462 kernel/locking/rwsem.c 	tmp = atomic_long_fetch_add_release(-RWSEM_WRITER_LOCKED, &sem->count);
sem              1464 kernel/locking/rwsem.c 		rwsem_wake(sem, tmp);
sem              1470 kernel/locking/rwsem.c static inline void __downgrade_write(struct rw_semaphore *sem)
sem              1481 kernel/locking/rwsem.c 	DEBUG_RWSEMS_WARN_ON(rwsem_owner(sem) != current, sem);
sem              1483 kernel/locking/rwsem.c 		-RWSEM_WRITER_LOCKED+RWSEM_READER_BIAS, &sem->count);
sem              1484 kernel/locking/rwsem.c 	rwsem_set_reader_owned(sem);
sem              1486 kernel/locking/rwsem.c 		rwsem_downgrade_wake(sem);
sem              1492 kernel/locking/rwsem.c void __sched down_read(struct rw_semaphore *sem)
sem              1495 kernel/locking/rwsem.c 	rwsem_acquire_read(&sem->dep_map, 0, 0, _RET_IP_);
sem              1497 kernel/locking/rwsem.c 	LOCK_CONTENDED(sem, __down_read_trylock, __down_read);
sem              1501 kernel/locking/rwsem.c int __sched down_read_killable(struct rw_semaphore *sem)
sem              1504 kernel/locking/rwsem.c 	rwsem_acquire_read(&sem->dep_map, 0, 0, _RET_IP_);
sem              1506 kernel/locking/rwsem.c 	if (LOCK_CONTENDED_RETURN(sem, __down_read_trylock, __down_read_killable)) {
sem              1507 kernel/locking/rwsem.c 		rwsem_release(&sem->dep_map, 1, _RET_IP_);
sem              1518 kernel/locking/rwsem.c int down_read_trylock(struct rw_semaphore *sem)
sem              1520 kernel/locking/rwsem.c 	int ret = __down_read_trylock(sem);
sem              1523 kernel/locking/rwsem.c 		rwsem_acquire_read(&sem->dep_map, 0, 1, _RET_IP_);
sem              1531 kernel/locking/rwsem.c void __sched down_write(struct rw_semaphore *sem)
sem              1534 kernel/locking/rwsem.c 	rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_);
sem              1535 kernel/locking/rwsem.c 	LOCK_CONTENDED(sem, __down_write_trylock, __down_write);
sem              1542 kernel/locking/rwsem.c int __sched down_write_killable(struct rw_semaphore *sem)
sem              1545 kernel/locking/rwsem.c 	rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_);
sem              1547 kernel/locking/rwsem.c 	if (LOCK_CONTENDED_RETURN(sem, __down_write_trylock,
sem              1549 kernel/locking/rwsem.c 		rwsem_release(&sem->dep_map, 1, _RET_IP_);
sem              1560 kernel/locking/rwsem.c int down_write_trylock(struct rw_semaphore *sem)
sem              1562 kernel/locking/rwsem.c 	int ret = __down_write_trylock(sem);
sem              1565 kernel/locking/rwsem.c 		rwsem_acquire(&sem->dep_map, 0, 1, _RET_IP_);
sem              1574 kernel/locking/rwsem.c void up_read(struct rw_semaphore *sem)
sem              1576 kernel/locking/rwsem.c 	rwsem_release(&sem->dep_map, 1, _RET_IP_);
sem              1577 kernel/locking/rwsem.c 	__up_read(sem);
sem              1584 kernel/locking/rwsem.c void up_write(struct rw_semaphore *sem)
sem              1586 kernel/locking/rwsem.c 	rwsem_release(&sem->dep_map, 1, _RET_IP_);
sem              1587 kernel/locking/rwsem.c 	__up_write(sem);
sem              1594 kernel/locking/rwsem.c void downgrade_write(struct rw_semaphore *sem)
sem              1596 kernel/locking/rwsem.c 	lock_downgrade(&sem->dep_map, _RET_IP_);
sem              1597 kernel/locking/rwsem.c 	__downgrade_write(sem);
sem              1603 kernel/locking/rwsem.c void down_read_nested(struct rw_semaphore *sem, int subclass)
sem              1606 kernel/locking/rwsem.c 	rwsem_acquire_read(&sem->dep_map, subclass, 0, _RET_IP_);
sem              1607 kernel/locking/rwsem.c 	LOCK_CONTENDED(sem, __down_read_trylock, __down_read);
sem              1611 kernel/locking/rwsem.c void _down_write_nest_lock(struct rw_semaphore *sem, struct lockdep_map *nest)
sem              1614 kernel/locking/rwsem.c 	rwsem_acquire_nest(&sem->dep_map, 0, 0, nest, _RET_IP_);
sem              1615 kernel/locking/rwsem.c 	LOCK_CONTENDED(sem, __down_write_trylock, __down_write);
sem              1619 kernel/locking/rwsem.c void down_read_non_owner(struct rw_semaphore *sem)
sem              1622 kernel/locking/rwsem.c 	__down_read(sem);
sem              1623 kernel/locking/rwsem.c 	__rwsem_set_reader_owned(sem, NULL);
sem              1627 kernel/locking/rwsem.c void down_write_nested(struct rw_semaphore *sem, int subclass)
sem              1630 kernel/locking/rwsem.c 	rwsem_acquire(&sem->dep_map, subclass, 0, _RET_IP_);
sem              1631 kernel/locking/rwsem.c 	LOCK_CONTENDED(sem, __down_write_trylock, __down_write);
sem              1635 kernel/locking/rwsem.c int __sched down_write_killable_nested(struct rw_semaphore *sem, int subclass)
sem              1638 kernel/locking/rwsem.c 	rwsem_acquire(&sem->dep_map, subclass, 0, _RET_IP_);
sem              1640 kernel/locking/rwsem.c 	if (LOCK_CONTENDED_RETURN(sem, __down_write_trylock,
sem              1642 kernel/locking/rwsem.c 		rwsem_release(&sem->dep_map, 1, _RET_IP_);
sem              1650 kernel/locking/rwsem.c void up_read_non_owner(struct rw_semaphore *sem)
sem              1652 kernel/locking/rwsem.c 	DEBUG_RWSEMS_WARN_ON(!is_rwsem_reader_owned(sem), sem);
sem              1653 kernel/locking/rwsem.c 	__up_read(sem);
sem                 7 kernel/locking/rwsem.h extern void __down_read(struct rw_semaphore *sem);
sem                 8 kernel/locking/rwsem.h extern void __up_read(struct rw_semaphore *sem);
sem                36 kernel/locking/semaphore.c static noinline void __down(struct semaphore *sem);
sem                37 kernel/locking/semaphore.c static noinline int __down_interruptible(struct semaphore *sem);
sem                38 kernel/locking/semaphore.c static noinline int __down_killable(struct semaphore *sem);
sem                39 kernel/locking/semaphore.c static noinline int __down_timeout(struct semaphore *sem, long timeout);
sem                40 kernel/locking/semaphore.c static noinline void __up(struct semaphore *sem);
sem                53 kernel/locking/semaphore.c void down(struct semaphore *sem)
sem                57 kernel/locking/semaphore.c 	raw_spin_lock_irqsave(&sem->lock, flags);
sem                58 kernel/locking/semaphore.c 	if (likely(sem->count > 0))
sem                59 kernel/locking/semaphore.c 		sem->count--;
sem                61 kernel/locking/semaphore.c 		__down(sem);
sem                62 kernel/locking/semaphore.c 	raw_spin_unlock_irqrestore(&sem->lock, flags);
sem                75 kernel/locking/semaphore.c int down_interruptible(struct semaphore *sem)
sem                80 kernel/locking/semaphore.c 	raw_spin_lock_irqsave(&sem->lock, flags);
sem                81 kernel/locking/semaphore.c 	if (likely(sem->count > 0))
sem                82 kernel/locking/semaphore.c 		sem->count--;
sem                84 kernel/locking/semaphore.c 		result = __down_interruptible(sem);
sem                85 kernel/locking/semaphore.c 	raw_spin_unlock_irqrestore(&sem->lock, flags);
sem               101 kernel/locking/semaphore.c int down_killable(struct semaphore *sem)
sem               106 kernel/locking/semaphore.c 	raw_spin_lock_irqsave(&sem->lock, flags);
sem               107 kernel/locking/semaphore.c 	if (likely(sem->count > 0))
sem               108 kernel/locking/semaphore.c 		sem->count--;
sem               110 kernel/locking/semaphore.c 		result = __down_killable(sem);
sem               111 kernel/locking/semaphore.c 	raw_spin_unlock_irqrestore(&sem->lock, flags);
sem               130 kernel/locking/semaphore.c int down_trylock(struct semaphore *sem)
sem               135 kernel/locking/semaphore.c 	raw_spin_lock_irqsave(&sem->lock, flags);
sem               136 kernel/locking/semaphore.c 	count = sem->count - 1;
sem               138 kernel/locking/semaphore.c 		sem->count = count;
sem               139 kernel/locking/semaphore.c 	raw_spin_unlock_irqrestore(&sem->lock, flags);
sem               155 kernel/locking/semaphore.c int down_timeout(struct semaphore *sem, long timeout)
sem               160 kernel/locking/semaphore.c 	raw_spin_lock_irqsave(&sem->lock, flags);
sem               161 kernel/locking/semaphore.c 	if (likely(sem->count > 0))
sem               162 kernel/locking/semaphore.c 		sem->count--;
sem               164 kernel/locking/semaphore.c 		result = __down_timeout(sem, timeout);
sem               165 kernel/locking/semaphore.c 	raw_spin_unlock_irqrestore(&sem->lock, flags);
sem               178 kernel/locking/semaphore.c void up(struct semaphore *sem)
sem               182 kernel/locking/semaphore.c 	raw_spin_lock_irqsave(&sem->lock, flags);
sem               183 kernel/locking/semaphore.c 	if (likely(list_empty(&sem->wait_list)))
sem               184 kernel/locking/semaphore.c 		sem->count++;
sem               186 kernel/locking/semaphore.c 		__up(sem);
sem               187 kernel/locking/semaphore.c 	raw_spin_unlock_irqrestore(&sem->lock, flags);
sem               204 kernel/locking/semaphore.c static inline int __sched __down_common(struct semaphore *sem, long state,
sem               209 kernel/locking/semaphore.c 	list_add_tail(&waiter.list, &sem->wait_list);
sem               219 kernel/locking/semaphore.c 		raw_spin_unlock_irq(&sem->lock);
sem               221 kernel/locking/semaphore.c 		raw_spin_lock_irq(&sem->lock);
sem               235 kernel/locking/semaphore.c static noinline void __sched __down(struct semaphore *sem)
sem               237 kernel/locking/semaphore.c 	__down_common(sem, TASK_UNINTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT);
sem               240 kernel/locking/semaphore.c static noinline int __sched __down_interruptible(struct semaphore *sem)
sem               242 kernel/locking/semaphore.c 	return __down_common(sem, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT);
sem               245 kernel/locking/semaphore.c static noinline int __sched __down_killable(struct semaphore *sem)
sem               247 kernel/locking/semaphore.c 	return __down_common(sem, TASK_KILLABLE, MAX_SCHEDULE_TIMEOUT);
sem               250 kernel/locking/semaphore.c static noinline int __sched __down_timeout(struct semaphore *sem, long timeout)
sem               252 kernel/locking/semaphore.c 	return __down_common(sem, TASK_UNINTERRUPTIBLE, timeout);
sem               255 kernel/locking/semaphore.c static noinline void __sched __up(struct semaphore *sem)
sem               257 kernel/locking/semaphore.c 	struct semaphore_waiter *waiter = list_first_entry(&sem->wait_list,
sem                58 kernel/taskstats.c 	struct rw_semaphore sem;
sem               125 kernel/taskstats.c 	down_read(&listeners->sem);
sem               140 kernel/taskstats.c 	up_read(&listeners->sem);
sem               149 kernel/taskstats.c 	down_write(&listeners->sem);
sem               156 kernel/taskstats.c 	up_write(&listeners->sem);
sem               306 kernel/taskstats.c 			down_write(&listeners->sem);
sem               314 kernel/taskstats.c 			up_write(&listeners->sem);
sem               324 kernel/taskstats.c 		down_write(&listeners->sem);
sem               332 kernel/taskstats.c 		up_write(&listeners->sem);
sem               703 kernel/taskstats.c 		init_rwsem(&(per_cpu(listener_array, i).sem));
sem                84 lib/digsig.c   	down_read(&key->sem);
sem               179 lib/digsig.c   	up_read(&key->sem);
sem                58 net/ceph/osd_client.c static inline bool rwsem_is_wrlocked(struct rw_semaphore *sem)
sem                62 net/ceph/osd_client.c 	if (unlikely(down_read_trylock(sem))) {
sem                64 net/ceph/osd_client.c 		up_read(sem);
sem               136 net/dns_resolver/dns_query.c 	down_read(&rkey->sem);
sem               164 net/dns_resolver/dns_query.c 	up_read(&rkey->sem);
sem               363 security/integrity/evm/evm_crypto.c 	down_read(&evm_key->sem);
sem               370 security/integrity/evm/evm_crypto.c 	up_read(&evm_key->sem);
sem                34 security/keys/dh.c 		down_read(&key->sem);
sem                51 security/keys/dh.c 		up_read(&key->sem);
sem               311 security/keys/encrypted-keys/encrypted.c 	down_read(&ukey->sem);
sem               315 security/keys/encrypted-keys/encrypted.c 		up_read(&ukey->sem);
sem               718 security/keys/encrypted-keys/encrypted.c 	up_read(&mkey->sem);
sem               956 security/keys/encrypted-keys/encrypted.c 	up_read(&mkey->sem);
sem               965 security/keys/encrypted-keys/encrypted.c 	up_read(&mkey->sem);
sem                37 security/keys/encrypted-keys/masterkey_trusted.c 	down_read(&tkey->sem);
sem               357 security/keys/gc.c 	down_write(&key->sem);
sem               362 security/keys/gc.c 	up_write(&key->sem);
sem               288 security/keys/key.c 	init_rwsem(&key->sem);
sem               289 security/keys/key.c 	lockdep_set_class(&key->sem, &type->lock_class);
sem               722 security/keys/key.c 	down_write(&key->sem);
sem               730 security/keys/key.c 	up_write(&key->sem);
sem               763 security/keys/key.c 	down_write(&key->sem);
sem               770 security/keys/key.c 	up_write(&key->sem);
sem              1013 security/keys/key.c 	down_write(&key->sem);
sem              1020 security/keys/key.c 	up_write(&key->sem);
sem              1049 security/keys/key.c 	down_write_nested(&key->sem, 1);
sem              1061 security/keys/key.c 	up_write(&key->sem);
sem              1079 security/keys/key.c 		down_write_nested(&key->sem, 1);
sem              1082 security/keys/key.c 		up_write(&key->sem);
sem               804 security/keys/keyctl.c 	down_read(&key->sem);
sem               808 security/keys/keyctl.c 	up_read(&key->sem);
sem               978 security/keys/keyctl.c 	down_write(&key->sem);
sem              1042 security/keys/keyctl.c 	up_write(&key->sem);
sem              1084 security/keys/keyctl.c 	down_write(&key->sem);
sem              1092 security/keys/keyctl.c 	up_write(&key->sem);
sem              1056 security/keys/keyring.c 	down_write(&keyring->sem);
sem              1067 security/keys/keyring.c 	up_write(&keyring->sem);
sem              1236 security/keys/keyring.c 	__acquires(&keyring->sem)
sem              1242 security/keys/keyring.c 	down_write(&keyring->sem);
sem              1258 security/keys/keyring.c 	__acquires(&l_keyring->sem)
sem              1259 security/keys/keyring.c 	__acquires(&u_keyring->sem)
sem              1271 security/keys/keyring.c 		down_write(&l_keyring->sem);
sem              1272 security/keys/keyring.c 		down_write_nested(&u_keyring->sem, 1);
sem              1274 security/keys/keyring.c 		down_write(&u_keyring->sem);
sem              1275 security/keys/keyring.c 		down_write_nested(&l_keyring->sem, 1);
sem              1381 security/keys/keyring.c 	__releases(&keyring->sem)
sem              1394 security/keys/keyring.c 	up_write(&keyring->sem);
sem              1468 security/keys/keyring.c 	__acquires(&keyring->sem)
sem              1473 security/keys/keyring.c 	down_write(&keyring->sem);
sem              1516 security/keys/keyring.c 	__releases(&keyring->sem)
sem              1520 security/keys/keyring.c 	up_write(&keyring->sem);
sem              1650 security/keys/keyring.c 	down_write(&keyring->sem);
sem              1662 security/keys/keyring.c 	up_write(&keyring->sem);
sem              1733 security/keys/keyring.c 	down_write(&keyring->sem);
sem              1736 security/keys/keyring.c 	up_write(&keyring->sem);
sem              1775 security/keys/keyring.c 	down_write(&keyring->sem);
sem              1785 security/keys/keyring.c 	up_write(&keyring->sem);
sem               381 security/keys/process_keys.c 		down_write(&new_cred->thread_keyring->sem);
sem               383 security/keys/process_keys.c 		up_write(&new_cred->thread_keyring->sem);
sem               394 security/keys/process_keys.c 		down_write(&new_cred->thread_keyring->sem);
sem               396 security/keys/process_keys.c 		up_write(&new_cred->thread_keyring->sem);
sem               728 security/keys/process_keys.c 		down_read(&ctx.cred->request_key_auth->sem);
sem               738 security/keys/process_keys.c 		up_read(&ctx.cred->request_key_auth->sem);
sem               285 security/keys/request_key.c 				down_read(&authkey->sem);
sem               291 security/keys/request_key.c 				up_read(&authkey->sem);
sem               187 security/keys/request_key_auth.c 		down_read(&cred->request_key_auth->sem);
sem               193 security/keys/request_key_auth.c 			up_read(&cred->request_key_auth->sem);
sem               202 security/keys/request_key_auth.c 		up_read(&cred->request_key_auth->sem);
sem                 5 tools/perf/util/rwsem.c int init_rwsem(struct rw_semaphore *sem)
sem                 7 tools/perf/util/rwsem.c 	return pthread_rwlock_init(&sem->lock, NULL);
sem                10 tools/perf/util/rwsem.c int exit_rwsem(struct rw_semaphore *sem)
sem                12 tools/perf/util/rwsem.c 	return pthread_rwlock_destroy(&sem->lock);
sem                15 tools/perf/util/rwsem.c int down_read(struct rw_semaphore *sem)
sem                17 tools/perf/util/rwsem.c 	return perf_singlethreaded ? 0 : pthread_rwlock_rdlock(&sem->lock);
sem                20 tools/perf/util/rwsem.c int up_read(struct rw_semaphore *sem)
sem                22 tools/perf/util/rwsem.c 	return perf_singlethreaded ? 0 : pthread_rwlock_unlock(&sem->lock);
sem                25 tools/perf/util/rwsem.c int down_write(struct rw_semaphore *sem)
sem                27 tools/perf/util/rwsem.c 	return perf_singlethreaded ? 0 : pthread_rwlock_wrlock(&sem->lock);
sem                30 tools/perf/util/rwsem.c int up_write(struct rw_semaphore *sem)
sem                32 tools/perf/util/rwsem.c 	return perf_singlethreaded ? 0 : pthread_rwlock_unlock(&sem->lock);
sem                10 tools/perf/util/rwsem.h int init_rwsem(struct rw_semaphore *sem);
sem                11 tools/perf/util/rwsem.h int exit_rwsem(struct rw_semaphore *sem);
sem                13 tools/perf/util/rwsem.h int down_read(struct rw_semaphore *sem);
sem                14 tools/perf/util/rwsem.h int up_read(struct rw_semaphore *sem);
sem                16 tools/perf/util/rwsem.h int down_write(struct rw_semaphore *sem);
sem                17 tools/perf/util/rwsem.h int up_write(struct rw_semaphore *sem);
sem               630 tools/power/acpi/os_specific/service_layers/osunixxf.c 	sem_t *sem;
sem               643 tools/power/acpi/os_specific/service_layers/osunixxf.c 		sem =
sem               646 tools/power/acpi/os_specific/service_layers/osunixxf.c 		if (!sem) {
sem               653 tools/power/acpi/os_specific/service_layers/osunixxf.c 	sem = acpi_os_allocate(sizeof(sem_t));
sem               654 tools/power/acpi/os_specific/service_layers/osunixxf.c 	if (!sem) {
sem               658 tools/power/acpi/os_specific/service_layers/osunixxf.c 	if (sem_init(sem, 0, initial_units) == -1) {
sem               659 tools/power/acpi/os_specific/service_layers/osunixxf.c 		acpi_os_free(sem);
sem               664 tools/power/acpi/os_specific/service_layers/osunixxf.c 	*out_handle = (acpi_handle)sem;
sem               682 tools/power/acpi/os_specific/service_layers/osunixxf.c 	sem_t *sem = (sem_t *) handle;
sem               684 tools/power/acpi/os_specific/service_layers/osunixxf.c 	if (!sem) {
sem               688 tools/power/acpi/os_specific/service_layers/osunixxf.c 	if (sem_close(sem) == -1) {
sem               692 tools/power/acpi/os_specific/service_layers/osunixxf.c 	if (sem_destroy(sem) == -1) {
sem               718 tools/power/acpi/os_specific/service_layers/osunixxf.c 	sem_t *sem = (sem_t *) handle;
sem               724 tools/power/acpi/os_specific/service_layers/osunixxf.c 	if (!sem) {
sem               738 tools/power/acpi/os_specific/service_layers/osunixxf.c 		if (sem_trywait(sem) == -1) {
sem               747 tools/power/acpi/os_specific/service_layers/osunixxf.c 		while (((ret_val = sem_wait(sem)) == -1) && (errno == EINTR)) {
sem               765 tools/power/acpi/os_specific/service_layers/osunixxf.c 			if (sem_trywait(sem) == 0) {
sem               801 tools/power/acpi/os_specific/service_layers/osunixxf.c 		while (((ret_val = sem_timedwait(sem, &time)) == -1)
sem               835 tools/power/acpi/os_specific/service_layers/osunixxf.c 	sem_t *sem = (sem_t *) handle;
sem               837 tools/power/acpi/os_specific/service_layers/osunixxf.c 	if (!sem) {
sem               841 tools/power/acpi/os_specific/service_layers/osunixxf.c 	if (sem_post(sem) == -1) {