Revert "tee: optee: interrupt an RPC when supplicant has been killed"

This reverts commit e6c7ea7d4d.

Replaced by commit ec18520f5e ("tee: optee: Fix supplicant wait loop").

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
This commit is contained in:
Tao Huang
2025-06-06 16:45:41 +08:00
parent 9d9ce2cb47
commit 40fac1a66c

View File

@@ -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);