diff --git a/drivers/tee/optee/supp.c b/drivers/tee/optee/supp.c index 2d556b79a67e..322a543b8c27 100644 --- a/drivers/tee/optee/supp.c +++ b/drivers/tee/optee/supp.c @@ -82,9 +82,6 @@ u32 optee_supp_thrd_req(struct tee_context *ctx, u32 func, size_t num_params, struct optee_supp_req *req; bool interruptable; u32 ret; - unsigned long timeleft; - int id; - struct optee_supp_req *get_req; /* * Return in case there is no supplicant available and @@ -117,17 +114,8 @@ u32 optee_supp_thrd_req(struct tee_context *ctx, u32 func, size_t num_params, * exclusive access again. */ while (wait_for_completion_interruptible(&req->c)) { - pr_err("Warning, Interrupting an RPC to supplicant!\n"); - timeleft = wait_for_completion_timeout(&req->c, msecs_to_jiffies(2000)); - if (timeleft) { - /* get completion, it means tee-supplicant is alive. */ - break; - } else { - /* timeout, it means tee-supplicant is dead, interrupting an RPC. */ - interruptable = true; - } - mutex_lock(&supp->mutex); + interruptable = !supp->ctx; if (interruptable) { /* * There's no supplicant available and since the @@ -146,14 +134,6 @@ u32 optee_supp_thrd_req(struct tee_context *ctx, u32 func, size_t num_params, list_del(&req->link); req->in_queue = false; } - - idr_for_each_entry(&supp->idr, get_req, id) { - if (get_req == req) { - idr_remove(&supp->idr, id); - supp->req_id = -1; - break; - } - } } mutex_unlock(&supp->mutex);