summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2021-01-22 17:13:07 +0300
committerArnd Bergmann <arnd@arndb.de>2021-01-22 17:13:08 +0300
commit156d02914b7d2d53bf047235991b12bd6cbd7d40 (patch)
treee8efbf58ba825fde20b44efde4426c7dd76b841b /drivers
parent8a996b2d8a03beae3cb6adfc12673778c192085d (diff)
parentdcb3b06d9c34f33a249f65c08805461fb0c4325b (diff)
downloadlinux-156d02914b7d2d53bf047235991b12bd6cbd7d40.tar.xz
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/tee/optee/call.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/tee/optee/call.c b/drivers/tee/optee/call.c
index c981757ba0d4..780d7c4fd756 100644
--- a/drivers/tee/optee/call.c
+++ b/drivers/tee/optee/call.c
@@ -7,6 +7,7 @@
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/mm.h>
+#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/tee_drv.h>
#include <linux/types.h>
@@ -148,7 +149,8 @@ u32 optee_do_call_with_arg(struct tee_context *ctx, phys_addr_t parg)
*/
optee_cq_wait_for_completion(&optee->call_queue, &w);
} else if (OPTEE_SMC_RETURN_IS_RPC(res.a0)) {
- might_sleep();
+ if (need_resched())
+ cond_resched();
param.a0 = res.a0;
param.a1 = res.a1;
param.a2 = res.a2;