Lines Matching +full:op +full:- +full:tee

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2015-2021, Linaro Limited
41 if (!optee->rpmb_scan_bus_done) { in optee_bus_scan_rpmb()
43 optee->rpmb_scan_bus_done = !ret; in optee_bus_scan_rpmb()
44 if (ret && ret != -ENODEV) in optee_bus_scan_rpmb()
54 schedule_work(&optee->rpmb_scan_bus_work); in optee_rpmb_intf_rdev()
70 if (optee->in_kernel_rpmb_routing) in rpmb_routing_model_show()
88 tee_device_set_dev_groups(optee->teedev, optee_dev_groups); in optee_set_dev_group()
89 tee_device_set_dev_groups(optee->supp_teedev, optee_dev_groups); in optee_set_dev_group()
95 struct tee_device *teedev = ctx->teedev; in optee_open()
100 return -ENOMEM; in optee_open()
102 if (teedev == optee->supp_teedev) { in optee_open()
105 mutex_lock(&optee->supp.mutex); in optee_open()
106 if (!optee->supp.ctx) { in optee_open()
108 optee->supp.ctx = ctx; in optee_open()
110 mutex_unlock(&optee->supp.mutex); in optee_open()
113 return -EBUSY; in optee_open()
116 if (!optee->scan_bus_done) { in optee_open()
117 INIT_WORK(&optee->scan_bus_work, optee_bus_scan); in optee_open()
118 schedule_work(&optee->scan_bus_work); in optee_open()
119 optee->scan_bus_done = true; in optee_open()
122 mutex_init(&ctxdata->mutex); in optee_open()
123 INIT_LIST_HEAD(&ctxdata->sess_list); in optee_open()
125 ctx->cap_memref_null = cap_memref_null; in optee_open()
126 ctx->data = ctxdata; in optee_open()
135 struct optee_context_data *ctxdata = ctx->data; in optee_release_helper()
142 list_for_each_entry_safe(sess, sess_tmp, &ctxdata->sess_list, in optee_release_helper()
144 list_del(&sess->list_node); in optee_release_helper()
145 close_session(ctx, sess->session_id, sess->use_sys_thread); in optee_release_helper()
149 ctx->data = NULL; in optee_release_helper()
159 struct optee *optee = tee_get_drvdata(ctx->teedev); in optee_release_supp()
163 optee_supp_release(&optee->supp); in optee_release_supp()
169 &optee->rpmb_intf); in optee_remove_common()
170 cancel_work_sync(&optee->rpmb_scan_bus_work); in optee_remove_common()
171 /* Unregister OP-TEE specific client devices on TEE bus */ in optee_remove_common()
176 teedev_close_context(optee->ctx); in optee_remove_common()
181 tee_device_unregister(optee->supp_teedev); in optee_remove_common()
182 tee_device_unregister(optee->teedev); in optee_remove_common()
184 tee_shm_pool_free(optee->pool); in optee_remove_common()
185 optee_supp_uninit(&optee->supp); in optee_remove_common()
186 mutex_destroy(&optee->call_queue.mutex); in optee_remove_common()
187 rpmb_dev_put(optee->rpmb_dev); in optee_remove_common()
188 mutex_destroy(&optee->rpmb_dev_mutex); in optee_remove_common()
203 * Therefore, we cannot reliably initialize the OP-TEE driver in the in optee_core_init()
207 return -ENODEV; in optee_core_init()
247 MODULE_DESCRIPTION("OP-TEE driver");