Skip to content

Commit

Permalink
tee: optee: Change wait to interruptible
Browse files Browse the repository at this point in the history
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: Takeshi Kihara <[email protected]>
Signed-off-by: Nguyen Bao Nguyen <[email protected]>
  • Loading branch information
takeshikihara authored and NguyenBNguyen committed Dec 5, 2023
1 parent 45a035e commit 6e11d09
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/tee/optee/rcar.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
/*
* 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
Expand Down Expand Up @@ -72,7 +72,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__);
Expand Down

0 comments on commit 6e11d09

Please sign in to comment.