• Home
  • Raw
  • Download

Lines Matching refs:teedev

32 static void tee_shm_release(struct tee_device *teedev, struct tee_shm *shm)  in tee_shm_release()  argument
38 poolm = teedev->pool->dma_buf_mgr; in tee_shm_release()
40 poolm = teedev->pool->private_mgr; in tee_shm_release()
44 int rc = teedev->desc->ops->shm_unregister(shm->ctx, shm); in tee_shm_release()
47 dev_err(teedev->dev.parent, in tee_shm_release()
57 tee_device_put(teedev); in tee_shm_release()
62 struct tee_device *teedev = ctx->teedev; in tee_shm_alloc() local
69 dev_err(teedev->dev.parent, in tee_shm_alloc()
75 dev_err(teedev->dev.parent, "invalid shm flags 0x%x", flags); in tee_shm_alloc()
79 if (!tee_device_get(teedev)) in tee_shm_alloc()
82 if (!teedev->pool) { in tee_shm_alloc()
98 poolm = teedev->pool->dma_buf_mgr; in tee_shm_alloc()
100 poolm = teedev->pool->private_mgr; in tee_shm_alloc()
109 mutex_lock(&teedev->mutex); in tee_shm_alloc()
110 shm->id = idr_alloc(&teedev->idr, shm, 1, 0, GFP_KERNEL); in tee_shm_alloc()
111 mutex_unlock(&teedev->mutex); in tee_shm_alloc()
126 tee_device_put(teedev); in tee_shm_alloc()
152 struct tee_device *teedev = ctx->teedev; in tee_shm_register() local
164 if (!tee_device_get(teedev)) in tee_shm_register()
167 if (!teedev->desc->ops->shm_register || in tee_shm_register()
168 !teedev->desc->ops->shm_unregister) { in tee_shm_register()
169 tee_device_put(teedev); in tee_shm_register()
226 mutex_lock(&teedev->mutex); in tee_shm_register()
227 shm->id = idr_alloc(&teedev->idr, shm, 1, 0, GFP_KERNEL); in tee_shm_register()
228 mutex_unlock(&teedev->mutex); in tee_shm_register()
235 rc = teedev->desc->ops->shm_register(ctx, shm, shm->pages, in tee_shm_register()
246 mutex_lock(&teedev->mutex); in tee_shm_register()
247 idr_remove(&teedev->idr, shm->id); in tee_shm_register()
248 mutex_unlock(&teedev->mutex); in tee_shm_register()
254 tee_device_put(teedev); in tee_shm_register()
412 struct tee_device *teedev; in tee_shm_get_from_id() local
418 teedev = ctx->teedev; in tee_shm_get_from_id()
419 mutex_lock(&teedev->mutex); in tee_shm_get_from_id()
420 shm = idr_find(&teedev->idr, id); in tee_shm_get_from_id()
430 mutex_unlock(&teedev->mutex); in tee_shm_get_from_id()
441 struct tee_device *teedev = shm->ctx->teedev; in tee_shm_put() local
444 mutex_lock(&teedev->mutex); in tee_shm_put()
453 idr_remove(&teedev->idr, shm->id); in tee_shm_put()
456 mutex_unlock(&teedev->mutex); in tee_shm_put()
459 tee_shm_release(teedev, shm); in tee_shm_put()