tee: optee: remove need_resched() before cond_resched()
Subsystems (2)
PATCH 1/1 tee: optee: remove need_resched() before cond_resched()
Testing need_resched() before cond_resched() is not needed as an equivalent test is done internally in cond_resched(). So drop the need_resched() test.
--- drivers/tee/optee/call.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/tee/optee/call.c +1 -2
@@ -149,8 +149,7 @@ 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)) { -if (need_resched ()) -cond_resched (); +cond_resched (); param.a0 = res.a0; param.a1 = res.a1; param.a2 = res.a2;
Signature · 1 line
2.25.1
Hi Rouven and Sumit,
Quoted 10 lines · Jens Wiklander
Testing
need_resched()beforecond_resched()is not needed as an equivalent test is done internally incond_resched(). So drop theneed_resched()test.Fixes dcb3b06d9c34 ("tee: optee: replace might_sleep with cond_resched")Signed-off-by Jens Wiklander <[email protected]>--- drivers/tee/optee/call.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Can you please test to see that this works in your setups too?
Thanks,
Jens
Quoted 7 lines · Jens Wiklander
Testing
need_resched()beforecond_resched()is not needed as an equivalent test is done internally incond_resched(). So drop theneed_resched()test.Fixes dcb3b06d9c34 ("tee: optee: replace might_sleep with cond_resched")Signed-off-by Jens Wiklander <[email protected]>
A message that is not in the archive (sent off-list or not yet received): =?utf-8?q?=3C0100017738faac80-87e5cf40-6a5a-4727-9c36-382fb909c?=
=?utf-8?q?8ff-000000=40email=2Eamazonses=2Ecom=3E?=
Hi Rouven and Sumit,
Quoted 10 lines · Jens Wiklander via OP-TEE
Hi Rouven and Sumit,
Quoted 5 lines · Jens Wiklander
Testing
need_resched()beforecond_resched()is not needed as an equivalent test is done internally incond_resched(). So drop theneed_resched()test.
Quoted 7 lines
Quoted 5 lines
Fixes dcb3b06d9c34 ("tee: optee: replace might_sleep with cond_resched")Signed-off-by Jens Wiklander <[email protected]>--- drivers/tee/optee/call.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)Can you please test to see that this works in your setups too?
Does this work for you? I'd like to get this patch ready for v5.12.
Thanks,
Jens
Quoted 20 lines · Jens Wiklander
Hi Rouven and Sumit,
Quoted 16 lines · Jens Wiklander via OP-TEE
Hi Rouven and Sumit,
Quoted 10 lines · Jens Wiklander
Testing
need_resched()beforecond_resched()is not needed as an equivalent test is done internally incond_resched(). So drop theneed_resched()test.Fixes dcb3b06d9c34 ("tee: optee: replace might_sleep with cond_resched")Signed-off-by Jens Wiklander <[email protected]>--- drivers/tee/optee/call.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 3 lines
Quoted 1 line
Can you please test to see that this works in your setups too?
Does this work for you? I'd like to get this patch ready for v5.12.
Sorry I did not get to this yet, I'll need to modify the existing kernelconfig again to reproduce the buggy configuration. I'll get this done by monday.
Regards,
Rouven
Hi Jens,
Quoted 20 lines · Jens Wiklander
Hi Rouven and Sumit,
Quoted 16 lines · Jens Wiklander via OP-TEE
Hi Rouven and Sumit,
Quoted 10 lines · Jens Wiklander
Testing
need_resched()beforecond_resched()is not needed as an equivalent test is done internally incond_resched(). So drop theneed_resched()test.Fixes dcb3b06d9c34 ("tee: optee: replace might_sleep with cond_resched")Signed-off-by Jens Wiklander <[email protected]>--- drivers/tee/optee/call.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 3 lines
Quoted 1 line
Can you please test to see that this works in your setups too?
Does this work for you? I'd like to get this patch ready for v5.12.
Yes it does. I also looked at it right after Arnds mail, so for future reference:
cond_resched()
_cond_resched() (ifndef CONFIG_PREEMPTION)
should_resched(0)
tif_need_resched() (+ preempt_count == 0 for current thread)while:
need_resched()
tif_need_resched()
You can add my
I also retested on the STM32-DK2 and the problem remains fixed:
Regrads and thanks for the patch,
Rouven
Sumit Garg
Tested-byHi Jens,
Quoted 21 lines · Jens Wiklander
Hi Rouven and Sumit,
Quoted 16 lines · Jens Wiklander via OP-TEE
Hi Rouven and Sumit,
Quoted 10 lines · Jens Wiklander
Testing
need_resched()beforecond_resched()is not needed as an equivalent test is done internally incond_resched(). So drop theneed_resched()test.Fixes dcb3b06d9c34 ("tee: optee: replace might_sleep with cond_resched")Signed-off-by Jens Wiklander <[email protected]>--- drivers/tee/optee/call.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 3 lines
Quoted 1 line
Can you please test to see that this works in your setups too?
Does this work for you? I'd like to get this patch ready for v5.12.
It does work for me as well.
-Sumit
Quoted 3 lines
Thanks,
Jens
Quoted 20 lines · Jens Wiklander
Hi Rouven and Sumit,
Quoted 16 lines · Jens Wiklander via OP-TEE
Hi Rouven and Sumit,
Quoted 10 lines · Jens Wiklander
Testing
need_resched()beforecond_resched()is not needed as an equivalent test is done internally incond_resched(). So drop theneed_resched()test.Fixes dcb3b06d9c34 ("tee: optee: replace might_sleep with cond_resched")Signed-off-by Jens Wiklander <[email protected]>--- drivers/tee/optee/call.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 3 lines
Quoted 1 line
Can you please test to see that this works in your setups too?
Does this work for you? I'd like to get this patch ready for v5.12.
Thanks for the help with this patch. I'll submit this up for v5.12.
Cheers,
Jens