diff --git a/drivers/tee/optee/optee_private.h b/drivers/tee/optee/optee_private.h index c2a9c987092c..04ae58892608 100644 --- a/drivers/tee/optee/optee_private.h +++ b/drivers/tee/optee/optee_private.h @@ -92,7 +92,6 @@ struct optee_supp { struct list_head reqs; struct idr idr; struct completion reqs_c; - bool shutdown; }; struct optee_smc { diff --git a/drivers/tee/optee/smc_abi.c b/drivers/tee/optee/smc_abi.c index fd082216f0eb..e6e0428f8e7b 100644 --- a/drivers/tee/optee/smc_abi.c +++ b/drivers/tee/optee/smc_abi.c @@ -7,7 +7,6 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include -#include #include #include #include @@ -1353,11 +1352,6 @@ static void optee_shutdown(struct platform_device *pdev) { struct optee *optee = platform_get_drvdata(pdev); - /* Tell requesting thread to interrupt an RPC */ - smp_store_mb(optee->supp.shutdown, true); - /* Wait requesting thread to release resources */ - mdelay(200); - if (!optee->rpc_param_count) optee_disable_shm_cache(optee); } diff --git a/drivers/tee/optee/supp.c b/drivers/tee/optee/supp.c index a8656a72d83a..322a543b8c27 100644 --- a/drivers/tee/optee/supp.c +++ b/drivers/tee/optee/supp.c @@ -82,8 +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; - int id; - struct optee_supp_req *get_req; /* * Return in case there is no supplicant available and @@ -116,15 +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)) { - if (supp->shutdown) { - /* Reboot happen, tee-supplicant is dead, interrupt an RPC */ - interruptable = true; - } else { - /* Deep sleep, tee-supplicant is freeze, wait tee-supplicant */ - continue; - } - mutex_lock(&supp->mutex); + interruptable = !supp->ctx; if (interruptable) { /* * There's no supplicant available and since the @@ -143,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);