lkml.org 
[lkml]   [2018]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] optee: fix the dead loop problem when there is signal pending
Date
when the current process is doing a rpc call from optee, and if there
is a signal pending on the process, it will enter dead loop if the
tee-supplicant is working correctly, fix the problem by breaking out
the loop when the rpc job is finished.

Signed-off-by: Zeng Tao <prime.zeng@hisilicon.com>
---
drivers/tee/optee/supp.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/tee/optee/supp.c b/drivers/tee/optee/supp.c
index b4ea067..170dedb 100644
--- a/drivers/tee/optee/supp.c
+++ b/drivers/tee/optee/supp.c
@@ -107,6 +107,13 @@ u32 optee_supp_thrd_req(struct tee_context *ctx, u32 func, size_t num_params,
mutex_unlock(&supp->ctx_mutex);
if (interruptable)
break;
+
+ /*
+ * if there is signal pending, and the supplicant has finished
+ * the rpc job, we need to break out the loop
+ */
+ if (try_wait_for_completion(&supp->data_from_supp))
+ break;
}

ret = supp->ret;
--
2.7.4
\
 
 \ /
  Last update: 2018-01-03 12:30    [W:0.012 / U:34.088 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site