Lines Matching refs:teedev

33 	struct tee_device *teedev = shm->ctx->teedev;  in tee_shm_release()  local
36 mutex_lock(&teedev->mutex); in tee_shm_release()
37 idr_remove(&teedev->idr, shm->id); in tee_shm_release()
38 mutex_unlock(&teedev->mutex); in tee_shm_release()
45 poolm = teedev->pool->dma_buf_mgr; in tee_shm_release()
47 poolm = teedev->pool->private_mgr; in tee_shm_release()
51 int rc = teedev->desc->ops->shm_unregister(shm->ctx, shm); in tee_shm_release()
54 dev_err(teedev->dev.parent, in tee_shm_release()
64 tee_device_put(teedev); in tee_shm_release()
108 struct tee_device *teedev = ctx->teedev; in tee_shm_alloc() local
115 dev_err(teedev->dev.parent, in tee_shm_alloc()
121 dev_err(teedev->dev.parent, "invalid shm flags 0x%x", flags); in tee_shm_alloc()
125 if (!tee_device_get(teedev)) in tee_shm_alloc()
128 if (!teedev->pool) { in tee_shm_alloc()
143 poolm = teedev->pool->dma_buf_mgr; in tee_shm_alloc()
145 poolm = teedev->pool->private_mgr; in tee_shm_alloc()
157 mutex_lock(&teedev->mutex); in tee_shm_alloc()
158 shm->id = idr_alloc(&teedev->idr, shm, 1, 0, GFP_KERNEL); in tee_shm_alloc()
159 mutex_unlock(&teedev->mutex); in tee_shm_alloc()
182 mutex_lock(&teedev->mutex); in tee_shm_alloc()
183 idr_remove(&teedev->idr, shm->id); in tee_shm_alloc()
184 mutex_unlock(&teedev->mutex); in tee_shm_alloc()
191 tee_device_put(teedev); in tee_shm_alloc()
217 struct tee_device *teedev = ctx->teedev; in tee_shm_register() local
229 if (!tee_device_get(teedev)) in tee_shm_register()
232 if (!teedev->desc->ops->shm_register || in tee_shm_register()
233 !teedev->desc->ops->shm_unregister) { in tee_shm_register()
234 tee_device_put(teedev); in tee_shm_register()
290 mutex_lock(&teedev->mutex); in tee_shm_register()
291 shm->id = idr_alloc(&teedev->idr, shm, 1, 0, GFP_KERNEL); in tee_shm_register()
292 mutex_unlock(&teedev->mutex); in tee_shm_register()
299 rc = teedev->desc->ops->shm_register(ctx, shm, shm->pages, in tee_shm_register()
317 teedev->desc->ops->shm_unregister(ctx, shm); in tee_shm_register()
326 mutex_lock(&teedev->mutex); in tee_shm_register()
327 idr_remove(&teedev->idr, shm->id); in tee_shm_register()
328 mutex_unlock(&teedev->mutex); in tee_shm_register()
334 tee_device_put(teedev); in tee_shm_register()
472 struct tee_device *teedev; in tee_shm_get_from_id() local
478 teedev = ctx->teedev; in tee_shm_get_from_id()
479 mutex_lock(&teedev->mutex); in tee_shm_get_from_id()
480 shm = idr_find(&teedev->idr, id); in tee_shm_get_from_id()
485 mutex_unlock(&teedev->mutex); in tee_shm_get_from_id()