* [PATCH] tee: optee: remove need_resched() before cond_resched()
@ 2021-01-25 9:54 ` Jens Wiklander
0 siblings, 0 replies; 13+ messages in thread
From: Jens Wiklander @ 2021-01-25 9:54 UTC (permalink / raw)
To: op-tee
[-- Attachment #1: Type: text/plain, Size: 917 bytes --]
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.
Fixes: dcb3b06d9c34 ("tee: optee: replace might_sleep with cond_resched")
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
drivers/tee/optee/call.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/tee/optee/call.c b/drivers/tee/optee/call.c
index 780d7c4fd756..7a77e375b503 100644
--- a/drivers/tee/optee/call.c
+++ b/drivers/tee/optee/call.c
@@ -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;
--
2.25.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH] tee: optee: remove need_resched() before cond_resched()
@ 2021-01-25 9:54 ` Jens Wiklander
0 siblings, 0 replies; 13+ messages in thread
From: Jens Wiklander @ 2021-01-25 9:54 UTC (permalink / raw)
To: linux-kernel, op-tee
Cc: Arnd Bergmann, Rouven Czerwinski, Sumit Garg, Jens Wiklander
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.
Fixes: dcb3b06d9c34 ("tee: optee: replace might_sleep with cond_resched")
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---
drivers/tee/optee/call.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/tee/optee/call.c b/drivers/tee/optee/call.c
index 780d7c4fd756..7a77e375b503 100644
--- a/drivers/tee/optee/call.c
+++ b/drivers/tee/optee/call.c
@@ -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;
--
2.25.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH] tee: optee: remove need_resched() before cond_resched()
2021-01-25 9:54 ` Jens Wiklander
@ 2021-01-25 9:57 ` Jens Wiklander
-1 siblings, 0 replies; 13+ messages in thread
From: Jens Wiklander @ 2021-01-25 9:57 UTC (permalink / raw)
To: op-tee
[-- Attachment #1: Type: text/plain, Size: 573 bytes --]
Hi Rouven and Sumit,
On Mon, Jan 25, 2021 at 10:55 AM Jens Wiklander
<jens.wiklander@linaro.org> wrote:
>
> 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.
>
> Fixes: dcb3b06d9c34 ("tee: optee: replace might_sleep with cond_resched")
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> ---
> 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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] tee: optee: remove need_resched() before cond_resched()
@ 2021-01-25 9:57 ` Jens Wiklander
0 siblings, 0 replies; 13+ messages in thread
From: Jens Wiklander @ 2021-01-25 9:57 UTC (permalink / raw)
To: Rouven Czerwinski, Sumit Garg
Cc: Arnd Bergmann, Linux Kernel Mailing List, op-tee
Hi Rouven and Sumit,
On Mon, Jan 25, 2021 at 10:55 AM Jens Wiklander
<jens.wiklander@linaro.org> wrote:
>
> 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.
>
> Fixes: dcb3b06d9c34 ("tee: optee: replace might_sleep with cond_resched")
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> ---
> 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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] tee: optee: remove need_resched() before cond_resched()
[not found] <=?utf-8?q?=3C0100017738faac80-87e5cf40-6a5a-4727-9c36-382fb909c?= =?utf-8?q?8ff-000000=40email=2Eamazonses=2Ecom=3E?=>
@ 2021-01-29 13:29 ` Jens Wiklander
0 siblings, 0 replies; 13+ messages in thread
From: Jens Wiklander @ 2021-01-29 13:29 UTC (permalink / raw)
To: op-tee
[-- Attachment #1: Type: text/plain, Size: 797 bytes --]
Hi Rouven and Sumit,
On Mon, Jan 25, 2021 at 10:58 AM Jens Wiklander via OP-TEE
<op-tee@lists.trustedfirmware.org> wrote:
>
> Hi Rouven and Sumit,
>
> On Mon, Jan 25, 2021 at 10:55 AM Jens Wiklander
> <jens.wiklander@linaro.org> wrote:
> >
> > 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.
> >
> > Fixes: dcb3b06d9c34 ("tee: optee: replace might_sleep with cond_resched")
> > Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> > ---
> > 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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] tee: optee: remove need_resched() before cond_resched()
[not found] < <CAHUa44GsbxO=wJ_o-AZsxNvKOhn=y=dexkrN17zCy=7+0=1ZQg@mail.gmail.com>
@ 2021-01-29 13:42 ` Rouven Czerwinski
2021-01-31 8:13 ` Rouven Czerwinski
` (2 subsequent siblings)
3 siblings, 0 replies; 13+ messages in thread
From: Rouven Czerwinski @ 2021-01-29 13:42 UTC (permalink / raw)
To: op-tee
[-- Attachment #1: Type: text/plain, Size: 1018 bytes --]
On 29.01.21 14:29, Jens Wiklander wrote:
> Hi Rouven and Sumit,
>
> On Mon, Jan 25, 2021 at 10:58 AM Jens Wiklander via OP-TEE
> <op-tee@lists.trustedfirmware.org> wrote:
>>
>> Hi Rouven and Sumit,
>>
>> On Mon, Jan 25, 2021 at 10:55 AM Jens Wiklander
>> <jens.wiklander@linaro.org> wrote:
>>>
>>> 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.
>>>
>>> Fixes: dcb3b06d9c34 ("tee: optee: replace might_sleep with cond_resched")
>>> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
>>> ---
>>> 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.
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
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] tee: optee: remove need_resched() before cond_resched()
2021-01-25 9:54 ` Jens Wiklander
(?)
(?)
@ 2021-01-29 13:58 ` Arnd Bergmann
-1 siblings, 0 replies; 13+ messages in thread
From: Arnd Bergmann @ 2021-01-29 13:58 UTC (permalink / raw)
To: op-tee
[-- Attachment #1: Type: text/plain, Size: 422 bytes --]
On Mon, Jan 25, 2021 at 10:54 AM Jens Wiklander
<jens.wiklander@linaro.org> wrote:
>
> 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.
>
> Fixes: dcb3b06d9c34 ("tee: optee: replace might_sleep with cond_resched")
> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] tee: optee: remove need_resched() before cond_resched()
2021-01-29 13:29 ` Jens Wiklander
@ 2021-01-31 8:13 ` Rouven Czerwinski
-1 siblings, 0 replies; 13+ messages in thread
From: Rouven Czerwinski @ 2021-01-31 8:13 UTC (permalink / raw)
To: op-tee
[-- Attachment #1: Type: text/plain, Size: 1392 bytes --]
Hi Jens,
On 29.01.21 14:29, Jens Wiklander wrote:
> Hi Rouven and Sumit,
>
> On Mon, Jan 25, 2021 at 10:58 AM Jens Wiklander via OP-TEE
> <op-tee@lists.trustedfirmware.org> wrote:
>>
>> Hi Rouven and Sumit,
>>
>> On Mon, Jan 25, 2021 at 10:55 AM Jens Wiklander
>> <jens.wiklander@linaro.org> wrote:
>>>
>>> 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.
>>>
>>> Fixes: dcb3b06d9c34 ("tee: optee: replace might_sleep with cond_resched")
>>> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
>>> ---
>>> 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.
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
Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
I also retested on the STM32-DK2 and the problem remains fixed:
Tested-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Regrads and thanks for the patch,
Rouven
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] tee: optee: remove need_resched() before cond_resched()
@ 2021-01-31 8:13 ` Rouven Czerwinski
0 siblings, 0 replies; 13+ messages in thread
From: Rouven Czerwinski @ 2021-01-31 8:13 UTC (permalink / raw)
To: Jens Wiklander, Sumit Garg
Cc: Arnd Bergmann, op-tee, Linux Kernel Mailing List
Hi Jens,
On 29.01.21 14:29, Jens Wiklander wrote:
> Hi Rouven and Sumit,
>
> On Mon, Jan 25, 2021 at 10:58 AM Jens Wiklander via OP-TEE
> <op-tee@lists.trustedfirmware.org> wrote:
>>
>> Hi Rouven and Sumit,
>>
>> On Mon, Jan 25, 2021 at 10:55 AM Jens Wiklander
>> <jens.wiklander@linaro.org> wrote:
>>>
>>> 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.
>>>
>>> Fixes: dcb3b06d9c34 ("tee: optee: replace might_sleep with cond_resched")
>>> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
>>> ---
>>> 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.
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
Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
I also retested on the STM32-DK2 and the problem remains fixed:
Tested-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Regrads and thanks for the patch,
Rouven
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] tee: optee: remove need_resched() before cond_resched()
2021-01-29 13:29 ` Jens Wiklander
@ 2021-02-01 5:02 ` Sumit Garg
-1 siblings, 0 replies; 13+ messages in thread
From: Sumit Garg @ 2021-02-01 5:02 UTC (permalink / raw)
To: op-tee
[-- Attachment #1: Type: text/plain, Size: 1061 bytes --]
Hi Jens,
On Fri, 29 Jan 2021 at 18:59, Jens Wiklander <jens.wiklander@linaro.org> wrote:
>
> Hi Rouven and Sumit,
>
> On Mon, Jan 25, 2021 at 10:58 AM Jens Wiklander via OP-TEE
> <op-tee@lists.trustedfirmware.org> wrote:
> >
> > Hi Rouven and Sumit,
> >
> > On Mon, Jan 25, 2021 at 10:55 AM Jens Wiklander
> > <jens.wiklander@linaro.org> wrote:
> > >
> > > 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.
> > >
> > > Fixes: dcb3b06d9c34 ("tee: optee: replace might_sleep with cond_resched")
> > > Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> > > ---
> > > 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.
It does work for me as well.
Tested-by: Sumit Garg <sumit.garg@linaro.org>
-Sumit
>
> Thanks,
> Jens
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] tee: optee: remove need_resched() before cond_resched()
@ 2021-02-01 5:02 ` Sumit Garg
0 siblings, 0 replies; 13+ messages in thread
From: Sumit Garg @ 2021-02-01 5:02 UTC (permalink / raw)
To: Jens Wiklander
Cc: Rouven Czerwinski, Arnd Bergmann, op-tee,
Linux Kernel Mailing List
Hi Jens,
On Fri, 29 Jan 2021 at 18:59, Jens Wiklander <jens.wiklander@linaro.org> wrote:
>
> Hi Rouven and Sumit,
>
> On Mon, Jan 25, 2021 at 10:58 AM Jens Wiklander via OP-TEE
> <op-tee@lists.trustedfirmware.org> wrote:
> >
> > Hi Rouven and Sumit,
> >
> > On Mon, Jan 25, 2021 at 10:55 AM Jens Wiklander
> > <jens.wiklander@linaro.org> wrote:
> > >
> > > 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.
> > >
> > > Fixes: dcb3b06d9c34 ("tee: optee: replace might_sleep with cond_resched")
> > > Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> > > ---
> > > 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.
It does work for me as well.
Tested-by: Sumit Garg <sumit.garg@linaro.org>
-Sumit
>
> Thanks,
> Jens
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] tee: optee: remove need_resched() before cond_resched()
2021-01-29 13:29 ` Jens Wiklander
@ 2021-02-03 7:10 ` Jens Wiklander
-1 siblings, 0 replies; 13+ messages in thread
From: Jens Wiklander @ 2021-02-03 7:10 UTC (permalink / raw)
To: op-tee
[-- Attachment #1: Type: text/plain, Size: 1005 bytes --]
On Fri, Jan 29, 2021 at 02:29:33PM +0100, Jens Wiklander wrote:
> Hi Rouven and Sumit,
>
> On Mon, Jan 25, 2021 at 10:58 AM Jens Wiklander via OP-TEE
> <op-tee@lists.trustedfirmware.org> wrote:
> >
> > Hi Rouven and Sumit,
> >
> > On Mon, Jan 25, 2021 at 10:55 AM Jens Wiklander
> > <jens.wiklander@linaro.org> wrote:
> > >
> > > 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.
> > >
> > > Fixes: dcb3b06d9c34 ("tee: optee: replace might_sleep with cond_resched")
> > > Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> > > ---
> > > 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 for the help with this patch. I'll submit this up for v5.12.
Cheers,
Jens
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] tee: optee: remove need_resched() before cond_resched()
@ 2021-02-03 7:10 ` Jens Wiklander
0 siblings, 0 replies; 13+ messages in thread
From: Jens Wiklander @ 2021-02-03 7:10 UTC (permalink / raw)
To: Rouven Czerwinski, Sumit Garg
Cc: Arnd Bergmann, op-tee, Linux Kernel Mailing List
On Fri, Jan 29, 2021 at 02:29:33PM +0100, Jens Wiklander wrote:
> Hi Rouven and Sumit,
>
> On Mon, Jan 25, 2021 at 10:58 AM Jens Wiklander via OP-TEE
> <op-tee@lists.trustedfirmware.org> wrote:
> >
> > Hi Rouven and Sumit,
> >
> > On Mon, Jan 25, 2021 at 10:55 AM Jens Wiklander
> > <jens.wiklander@linaro.org> wrote:
> > >
> > > 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.
> > >
> > > Fixes: dcb3b06d9c34 ("tee: optee: replace might_sleep with cond_resched")
> > > Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
> > > ---
> > > 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 for the help with this patch. I'll submit this up for v5.12.
Cheers,
Jens
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2021-02-03 7:11 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] < <CAHUa44GsbxO=wJ_o-AZsxNvKOhn=y=dexkrN17zCy=7+0=1ZQg@mail.gmail.com>
2021-01-29 13:42 ` [PATCH] tee: optee: remove need_resched() before cond_resched() Rouven Czerwinski
2021-01-31 8:13 ` Rouven Czerwinski
2021-01-31 8:13 ` Rouven Czerwinski
2021-02-01 5:02 ` Sumit Garg
2021-02-01 5:02 ` Sumit Garg
2021-02-03 7:10 ` Jens Wiklander
2021-02-03 7:10 ` Jens Wiklander
[not found] <=?utf-8?q?=3C0100017738faac80-87e5cf40-6a5a-4727-9c36-382fb909c?= =?utf-8?q?8ff-000000=40email=2Eamazonses=2Ecom=3E?=>
2021-01-29 13:29 ` Jens Wiklander
2021-01-25 9:54 Jens Wiklander
2021-01-25 9:54 ` Jens Wiklander
2021-01-25 9:57 ` Jens Wiklander
2021-01-25 9:57 ` Jens Wiklander
2021-01-29 13:58 ` Arnd Bergmann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.