From: Zeng Tao <prime.zeng@hisilicon.com>
To: <jens.wiklander@linaro.org>
Cc: <linux-kernel@vger.kernel.org>, <tee-dev@lists.linaro.org>
Subject: [PATCH] optee: fix the dead loop problem when there is signal pending
Date: Thu, 4 Jan 2018 03:30:50 +0800 [thread overview]
Message-ID: <1515007850-17169-1-git-send-email-prime.zeng@hisilicon.com> (raw)
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
next reply other threads:[~2018-01-03 11:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-03 19:30 Zeng Tao [this message]
2018-02-26 20:18 ` [PATCH] optee: fix the dead loop problem when there is signal pending Jens Wiklander
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1515007850-17169-1-git-send-email-prime.zeng@hisilicon.com \
--to=prime.zeng@hisilicon.com \
--cc=jens.wiklander@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tee-dev@lists.linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).