diff options
author | Hiroki Negishi <hiroki.negishi.bx@renesas.com> | 2019-01-24 20:36:33 +0900 |
---|---|---|
committer | Ryo Kataoka <ryo.kataoka.wt@renesas.com> | 2019-03-22 20:50:12 +0900 |
commit | 5a502ea6069a126227d05b31f1b310ff3421c4f0 (patch) | |
tree | d745af88c0a3fea5711d05986f9acf7deaafbe33 | |
parent | 21f292435bf7381d0efb23696d7f275acdb3cabc (diff) | |
download | renesas-bsp-5a502ea6069a126227d05b31f1b310ff3421c4f0.tar.gz |
tee: optee: Change wait to interruptible
The thread of R-Car OP-TEE driver waits for RPC debug log command
from OP-TEE, with wait_event (i.e. in TASK_UNINTERRUPTIBLE state).
In case OP-TEE does't output the debug log for a long time,
a hung task warning occurs when CONFIG_DETECT_HUNG_TASK is set:
INFO: task optee_debug_log:1855 blocked for more than 120 seconds.
Tainted: G O 4.14.75-ltsi-yocto-standard #3
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
optee_debug_log D 0 1855 2 0x00000020
Call trace:
[<ffff000008085cf4>] __switch_to+0x94/0xd8
[<ffff000008b247c4>] __schedule+0x1c4/0x710
[<ffff000008b24d48>] schedule+0x38/0xa0
[<ffff0000089cfcfc>] debug_log_kthread+0xc4/0x130
[<ffff0000080eef2c>] kthread+0x12c/0x130
[<ffff000008084ed8>] ret_from_fork+0x10/0x18
This patch changes to wait in TASK_INTERRUPTIBLE state
to solve a hung task warning.
Signed-off-by: Hiroki Negishi <hiroki.negishi.bx@renesas.com>
-rw-r--r-- | drivers/tee/optee/rcar.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/tee/optee/rcar.c b/drivers/tee/optee/rcar.c index c34d959f4c63d..2f62764c6842d 100644 --- a/drivers/tee/optee/rcar.c +++ b/drivers/tee/optee/rcar.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2018, Renesas Electronics Corporation + * Copyright (c) 2015-2019, Renesas Electronics Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 as @@ -70,7 +70,8 @@ static int debug_log_kthread(void *arg) } if (thread_exit) break; - wait_event(dlog->waitq, !list_empty(&dlog->queue)); + wait_event_interruptible(dlog->waitq, + !list_empty(&dlog->queue)); } pr_info("%s Exit\n", __func__); @@ -103,7 +104,7 @@ void handle_rpc_func_cmd_debug_log(struct optee_msg_arg *arg) spin_lock(&dlog->q_lock); list_add_tail(&node->list, &dlog->queue); spin_unlock(&dlog->q_lock); - wake_up(&dlog->waitq); + wake_up_interruptible(&dlog->waitq); arg->ret = TEEC_SUCCESS; } else { arg->ret = TEEC_ERROR_OUT_OF_MEMORY; |