• Home
  • Raw
  • Download

Lines Matching refs:supp

22 void optee_supp_init(struct optee_supp *supp)  in optee_supp_init()  argument
24 memset(supp, 0, sizeof(*supp)); in optee_supp_init()
25 mutex_init(&supp->mutex); in optee_supp_init()
26 init_completion(&supp->reqs_c); in optee_supp_init()
27 idr_init(&supp->idr); in optee_supp_init()
28 INIT_LIST_HEAD(&supp->reqs); in optee_supp_init()
29 supp->req_id = -1; in optee_supp_init()
32 void optee_supp_uninit(struct optee_supp *supp) in optee_supp_uninit() argument
34 mutex_destroy(&supp->mutex); in optee_supp_uninit()
35 idr_destroy(&supp->idr); in optee_supp_uninit()
38 void optee_supp_release(struct optee_supp *supp) in optee_supp_release() argument
44 mutex_lock(&supp->mutex); in optee_supp_release()
47 idr_for_each_entry(&supp->idr, req, id) { in optee_supp_release()
48 idr_remove(&supp->idr, id); in optee_supp_release()
54 list_for_each_entry_safe(req, req_tmp, &supp->reqs, link) { in optee_supp_release()
61 supp->ctx = NULL; in optee_supp_release()
62 supp->req_id = -1; in optee_supp_release()
64 mutex_unlock(&supp->mutex); in optee_supp_release()
81 struct optee_supp *supp = &optee->supp; in optee_supp_thrd_req() local
90 if (!supp->ctx && ctx->supp_nowait) in optee_supp_thrd_req()
103 mutex_lock(&supp->mutex); in optee_supp_thrd_req()
104 list_add_tail(&req->link, &supp->reqs); in optee_supp_thrd_req()
106 mutex_unlock(&supp->mutex); in optee_supp_thrd_req()
109 complete(&supp->reqs_c); in optee_supp_thrd_req()
117 mutex_lock(&supp->mutex); in optee_supp_thrd_req()
118 interruptable = !supp->ctx; in optee_supp_thrd_req()
138 mutex_unlock(&supp->mutex); in optee_supp_thrd_req()
152 static struct optee_supp_req *supp_pop_entry(struct optee_supp *supp, in supp_pop_entry() argument
157 if (supp->req_id != -1) { in supp_pop_entry()
165 if (list_empty(&supp->reqs)) in supp_pop_entry()
168 req = list_first_entry(&supp->reqs, struct optee_supp_req, link); in supp_pop_entry()
175 *id = idr_alloc(&supp->idr, req, 1, 0, GFP_KERNEL); in supp_pop_entry()
234 struct optee_supp *supp = &optee->supp; in optee_supp_recv() local
245 mutex_lock(&supp->mutex); in optee_supp_recv()
246 req = supp_pop_entry(supp, *num_params - num_meta, &id); in optee_supp_recv()
247 mutex_unlock(&supp->mutex); in optee_supp_recv()
263 if (wait_for_completion_interruptible(&supp->reqs_c)) in optee_supp_recv()
278 mutex_lock(&supp->mutex); in optee_supp_recv()
279 supp->req_id = id; in optee_supp_recv()
280 mutex_unlock(&supp->mutex); in optee_supp_recv()
291 static struct optee_supp_req *supp_pop_req(struct optee_supp *supp, in supp_pop_req() argument
305 if (supp->req_id == -1) { in supp_pop_req()
311 id = supp->req_id; in supp_pop_req()
315 req = idr_find(&supp->idr, id); in supp_pop_req()
322 idr_remove(&supp->idr, id); in supp_pop_req()
323 supp->req_id = -1; in supp_pop_req()
343 struct optee_supp *supp = &optee->supp; in optee_supp_send() local
348 mutex_lock(&supp->mutex); in optee_supp_send()
349 req = supp_pop_req(supp, num_params, param, &num_meta); in optee_supp_send()
350 mutex_unlock(&supp->mutex); in optee_supp_send()