Lines Matching refs:supp

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