mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] remoteproc: k3-r5: Delay notification of wakeup event
@ 2024-08-20 10:50 Beleswar Padhi
  2024-09-03 10:15 ` Beleswar Prasad Padhi
  0 siblings, 1 reply; 4+ messages in thread
From: Beleswar Padhi @ 2024-08-20 10:50 UTC (permalink / raw)
  To: andersson, mathieu.poirier, afd
  Cc: hnagalla, u-kumar1, linux-remoteproc, linux-kernel

From: Udit Kumar <u-kumar1@ti.com>

Few times, core1 was scheduled to boot first before core0, which leads
to error:

'k3_r5_rproc_start: can not start core 1 before core 0'.

This was happening due to some scheduling between prepare and start
callback. The probe function waits for event, which is getting
triggered by prepare callback. To avoid above condition move event
trigger to start instead of prepare callback.

Fixes: 61f6f68447ab ("remoteproc: k3-r5: Wait for core0 power-up before powering up core1")
Signed-off-by: Udit Kumar <u-kumar1@ti.com>
[ Applied wakeup event trigger only for Split-Mode booted rprocs ]
Signed-off-by: Beleswar Padhi <b-padhi@ti.com>
---
v2: Changelog:
* Mathieu
1) Rebased changes on top of -next-20240820 tag.

Link to v1:
https://lore.kernel.org/all/20240809060132.308642-1-b-padhi@ti.com/

 drivers/remoteproc/ti_k3_r5_remoteproc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c
index 8a63a9360c0f..e61e53381abc 100644
--- a/drivers/remoteproc/ti_k3_r5_remoteproc.c
+++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c
@@ -469,8 +469,6 @@ static int k3_r5_rproc_prepare(struct rproc *rproc)
 			ret);
 		return ret;
 	}
-	core->released_from_reset = true;
-	wake_up_interruptible(&cluster->core_transition);
 
 	/*
 	 * Newer IP revisions like on J7200 SoCs support h/w auto-initialization
@@ -587,6 +585,9 @@ static int k3_r5_rproc_start(struct rproc *rproc)
 		ret = k3_r5_core_run(core);
 		if (ret)
 			return ret;
+
+		core->released_from_reset = true;
+		wake_up_interruptible(&cluster->core_transition);
 	}
 
 	return 0;
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] remoteproc: k3-r5: Delay notification of wakeup event
  2024-08-20 10:50 [PATCH v2] remoteproc: k3-r5: Delay notification of wakeup event Beleswar Padhi
@ 2024-09-03 10:15 ` Beleswar Prasad Padhi
  2024-09-03 14:32   ` Mathieu Poirier
  0 siblings, 1 reply; 4+ messages in thread
From: Beleswar Prasad Padhi @ 2024-09-03 10:15 UTC (permalink / raw)
  To: andersson, mathieu.poirier, afd
  Cc: hnagalla, u-kumar1, linux-remoteproc, linux-kernel

Hi Mathieu,

On 20-08-2024 16:20, Beleswar Padhi wrote:
> From: Udit Kumar <u-kumar1@ti.com>
>
> Few times, core1 was scheduled to boot first before core0, which leads
> to error:
>
> 'k3_r5_rproc_start: can not start core 1 before core 0'.
>
> This was happening due to some scheduling between prepare and start
> callback. The probe function waits for event, which is getting
> triggered by prepare callback. To avoid above condition move event
> trigger to start instead of prepare callback.
>
> Fixes: 61f6f68447ab ("remoteproc: k3-r5: Wait for core0 power-up before powering up core1")


Please put this patch on hold. I have some additional changelog that 
should go in v3.

Thanks,
Beleswar

> Signed-off-by: Udit Kumar <u-kumar1@ti.com>
> [ Applied wakeup event trigger only for Split-Mode booted rprocs ]
> Signed-off-by: Beleswar Padhi <b-padhi@ti.com>
> ---
> v2: Changelog:
> * Mathieu
> 1) Rebased changes on top of -next-20240820 tag.
>
> Link to v1:
> https://lore.kernel.org/all/20240809060132.308642-1-b-padhi@ti.com/
>
>   drivers/remoteproc/ti_k3_r5_remoteproc.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c
> index 8a63a9360c0f..e61e53381abc 100644
> --- a/drivers/remoteproc/ti_k3_r5_remoteproc.c
> +++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c
> @@ -469,8 +469,6 @@ static int k3_r5_rproc_prepare(struct rproc *rproc)
>   			ret);
>   		return ret;
>   	}
> -	core->released_from_reset = true;
> -	wake_up_interruptible(&cluster->core_transition);
>   
>   	/*
>   	 * Newer IP revisions like on J7200 SoCs support h/w auto-initialization
> @@ -587,6 +585,9 @@ static int k3_r5_rproc_start(struct rproc *rproc)
>   		ret = k3_r5_core_run(core);
>   		if (ret)
>   			return ret;
> +
> +		core->released_from_reset = true;
> +		wake_up_interruptible(&cluster->core_transition);
>   	}
>   
>   	return 0;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] remoteproc: k3-r5: Delay notification of wakeup event
  2024-09-03 10:15 ` Beleswar Prasad Padhi
@ 2024-09-03 14:32   ` Mathieu Poirier
  2024-09-04 11:20     ` Beleswar Prasad Padhi
  0 siblings, 1 reply; 4+ messages in thread
From: Mathieu Poirier @ 2024-09-03 14:32 UTC (permalink / raw)
  To: Beleswar Prasad Padhi
  Cc: andersson, afd, hnagalla, u-kumar1, linux-remoteproc, linux-kernel

On Tue, 3 Sept 2024 at 04:15, Beleswar Prasad Padhi <b-padhi@ti.com> wrote:
>
> Hi Mathieu,
>
> On 20-08-2024 16:20, Beleswar Padhi wrote:
> > From: Udit Kumar <u-kumar1@ti.com>
> >
> > Few times, core1 was scheduled to boot first before core0, which leads
> > to error:
> >
> > 'k3_r5_rproc_start: can not start core 1 before core 0'.
> >
> > This was happening due to some scheduling between prepare and start
> > callback. The probe function waits for event, which is getting
> > triggered by prepare callback. To avoid above condition move event
> > trigger to start instead of prepare callback.
> >
> > Fixes: 61f6f68447ab ("remoteproc: k3-r5: Wait for core0 power-up before powering up core1")
>
>
> Please put this patch on hold. I have some additional changelog that
> should go in v3.
>

I applied this patch a couple of weeks ago - are those changes to the
code?  If so please send another patch on top of rproc-next.

> Thanks,
> Beleswar
>
> > Signed-off-by: Udit Kumar <u-kumar1@ti.com>
> > [ Applied wakeup event trigger only for Split-Mode booted rprocs ]
> > Signed-off-by: Beleswar Padhi <b-padhi@ti.com>
> > ---
> > v2: Changelog:
> > * Mathieu
> > 1) Rebased changes on top of -next-20240820 tag.
> >
> > Link to v1:
> > https://lore.kernel.org/all/20240809060132.308642-1-b-padhi@ti.com/
> >
> >   drivers/remoteproc/ti_k3_r5_remoteproc.c | 5 +++--
> >   1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c
> > index 8a63a9360c0f..e61e53381abc 100644
> > --- a/drivers/remoteproc/ti_k3_r5_remoteproc.c
> > +++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c
> > @@ -469,8 +469,6 @@ static int k3_r5_rproc_prepare(struct rproc *rproc)
> >                       ret);
> >               return ret;
> >       }
> > -     core->released_from_reset = true;
> > -     wake_up_interruptible(&cluster->core_transition);
> >
> >       /*
> >        * Newer IP revisions like on J7200 SoCs support h/w auto-initialization
> > @@ -587,6 +585,9 @@ static int k3_r5_rproc_start(struct rproc *rproc)
> >               ret = k3_r5_core_run(core);
> >               if (ret)
> >                       return ret;
> > +
> > +             core->released_from_reset = true;
> > +             wake_up_interruptible(&cluster->core_transition);
> >       }
> >
> >       return 0;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] remoteproc: k3-r5: Delay notification of wakeup event
  2024-09-03 14:32   ` Mathieu Poirier
@ 2024-09-04 11:20     ` Beleswar Prasad Padhi
  0 siblings, 0 replies; 4+ messages in thread
From: Beleswar Prasad Padhi @ 2024-09-04 11:20 UTC (permalink / raw)
  To: Mathieu Poirier
  Cc: andersson, afd, hnagalla, u-kumar1, linux-remoteproc, linux-kernel


On 03-09-2024 20:02, Mathieu Poirier wrote:
> On Tue, 3 Sept 2024 at 04:15, Beleswar Prasad Padhi <b-padhi@ti.com> wrote:
>> Hi Mathieu,
>>
>> On 20-08-2024 16:20, Beleswar Padhi wrote:
>>> From: Udit Kumar <u-kumar1@ti.com>
>>>
>>> Few times, core1 was scheduled to boot first before core0, which leads
>>> to error:
>>>
>>> 'k3_r5_rproc_start: can not start core 1 before core 0'.
>>>
>>> This was happening due to some scheduling between prepare and start
>>> callback. The probe function waits for event, which is getting
>>> triggered by prepare callback. To avoid above condition move event
>>> trigger to start instead of prepare callback.
>>>
>>> Fixes: 61f6f68447ab ("remoteproc: k3-r5: Wait for core0 power-up before powering up core1")
>>
>> Please put this patch on hold. I have some additional changelog that
>> should go in v3.
>>
> I applied this patch a couple of weeks ago - are those changes to the
> code?  If so please send another patch on top of rproc-next.


Understood. Those are code changes, I will post another patch series for 
the same.

Thanks,
Beleswar

>
>> Thanks,
>> Beleswar
>>
>>> Signed-off-by: Udit Kumar <u-kumar1@ti.com>
>>> [ Applied wakeup event trigger only for Split-Mode booted rprocs ]
>>> Signed-off-by: Beleswar Padhi <b-padhi@ti.com>
>>> ---
>>> v2: Changelog:
>>> * Mathieu
>>> 1) Rebased changes on top of -next-20240820 tag.
>>>
>>> Link to v1:
>>> https://lore.kernel.org/all/20240809060132.308642-1-b-padhi@ti.com/
>>>
>>>    drivers/remoteproc/ti_k3_r5_remoteproc.c | 5 +++--
>>>    1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c
>>> index 8a63a9360c0f..e61e53381abc 100644
>>> --- a/drivers/remoteproc/ti_k3_r5_remoteproc.c
>>> +++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c
>>> @@ -469,8 +469,6 @@ static int k3_r5_rproc_prepare(struct rproc *rproc)
>>>                        ret);
>>>                return ret;
>>>        }
>>> -     core->released_from_reset = true;
>>> -     wake_up_interruptible(&cluster->core_transition);
>>>
>>>        /*
>>>         * Newer IP revisions like on J7200 SoCs support h/w auto-initialization
>>> @@ -587,6 +585,9 @@ static int k3_r5_rproc_start(struct rproc *rproc)
>>>                ret = k3_r5_core_run(core);
>>>                if (ret)
>>>                        return ret;
>>> +
>>> +             core->released_from_reset = true;
>>> +             wake_up_interruptible(&cluster->core_transition);
>>>        }
>>>
>>>        return 0;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-09-04 11:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-20 10:50 [PATCH v2] remoteproc: k3-r5: Delay notification of wakeup event Beleswar Padhi
2024-09-03 10:15 ` Beleswar Prasad Padhi
2024-09-03 14:32   ` Mathieu Poirier
2024-09-04 11:20     ` Beleswar Prasad Padhi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®