Skip to content

Commit 156d029

Browse files
committed
Merge tag 'optee-rcu-sched-trace-for-v5.11' of git://git.linaro.org/people/jens.wiklander/linux-tee into arm/fixes
Fix rcu_sched trace from OP-TEE invoke Replaces might_sleep() with a conditional call to cond_resched() in order to avoid the rcu_sched trace in some corner cases. * tag 'optee-rcu-sched-trace-for-v5.11' of git://git.linaro.org/people/jens.wiklander/linux-tee: tee: optee: replace might_sleep with cond_resched Link: https://lore.kernel.org/r/20210122074234.GA1074747@jade Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents 8a996b2 + dcb3b06 commit 156d029

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/tee/optee/call.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <linux/err.h>
88
#include <linux/errno.h>
99
#include <linux/mm.h>
10+
#include <linux/sched.h>
1011
#include <linux/slab.h>
1112
#include <linux/tee_drv.h>
1213
#include <linux/types.h>
@@ -148,7 +149,8 @@ u32 optee_do_call_with_arg(struct tee_context *ctx, phys_addr_t parg)
148149
*/
149150
optee_cq_wait_for_completion(&optee->call_queue, &w);
150151
} else if (OPTEE_SMC_RETURN_IS_RPC(res.a0)) {
151-
might_sleep();
152+
if (need_resched())
153+
cond_resched();
152154
param.a0 = res.a0;
153155
param.a1 = res.a1;
154156
param.a2 = res.a2;

0 commit comments

Comments
 (0)