All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] remoteproc: stm32: Improve crash recovery time
@ 2021-12-21 14:31 Arnaud Pouliquen
  2022-01-03 18:52 ` Mathieu Poirier
  0 siblings, 1 reply; 2+ messages in thread
From: Arnaud Pouliquen @ 2021-12-21 14:31 UTC (permalink / raw)
  To: Bjorn Andersson, Mathieu Poirier
  Cc: linux-remoteproc, linux-kernel, linux-stm32, arnaud.pouliquen

When a stop is requested on a crash, it is useless to try to shutdown it
gracefully, it is crashed.

In this case don't send the STM32_MBX_SHUTDOWN mailbox message that
will block the recovery during 500 ms, waiting an answer from the
coprocessor.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
---
 drivers/remoteproc/stm32_rproc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c
index b643efcf995a..7d782ed9e589 100644
--- a/drivers/remoteproc/stm32_rproc.c
+++ b/drivers/remoteproc/stm32_rproc.c
@@ -494,7 +494,7 @@ static int stm32_rproc_stop(struct rproc *rproc)
 	int err, idx;
 
 	/* request shutdown of the remote processor */
-	if (rproc->state != RPROC_OFFLINE) {
+	if (rproc->state != RPROC_OFFLINE && rproc->state != RPROC_CRASHED) {
 		idx = stm32_rproc_mbox_idx(rproc, STM32_MBX_SHUTDOWN);
 		if (idx >= 0 && ddata->mb[idx].chan) {
 			err = mbox_send_message(ddata->mb[idx].chan, "detach");
-- 
2.17.1


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

* Re: [PATCH] remoteproc: stm32: Improve crash recovery time
  2021-12-21 14:31 [PATCH] remoteproc: stm32: Improve crash recovery time Arnaud Pouliquen
@ 2022-01-03 18:52 ` Mathieu Poirier
  0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Poirier @ 2022-01-03 18:52 UTC (permalink / raw)
  To: Arnaud Pouliquen
  Cc: Bjorn Andersson, linux-remoteproc, linux-kernel, linux-stm32

On Tue, Dec 21, 2021 at 03:31:29PM +0100, Arnaud Pouliquen wrote:
> When a stop is requested on a crash, it is useless to try to shutdown it
> gracefully, it is crashed.
>

Right

> In this case don't send the STM32_MBX_SHUTDOWN mailbox message that
> will block the recovery during 500 ms, waiting an answer from the
> coprocessor.
> 
> Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
> ---
>  drivers/remoteproc/stm32_rproc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c
> index b643efcf995a..7d782ed9e589 100644
> --- a/drivers/remoteproc/stm32_rproc.c
> +++ b/drivers/remoteproc/stm32_rproc.c
> @@ -494,7 +494,7 @@ static int stm32_rproc_stop(struct rproc *rproc)
>  	int err, idx;
>  
>  	/* request shutdown of the remote processor */
> -	if (rproc->state != RPROC_OFFLINE) {
> +	if (rproc->state != RPROC_OFFLINE && rproc->state != RPROC_CRASHED) {
>  		idx = stm32_rproc_mbox_idx(rproc, STM32_MBX_SHUTDOWN);
>  		if (idx >= 0 && ddata->mb[idx].chan) {
>  			err = mbox_send_message(ddata->mb[idx].chan, "detach");

I have applied this patch.

Thanks,
Mathieu

> -- 
> 2.17.1
> 

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

end of thread, other threads:[~2022-01-03 18:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-21 14:31 [PATCH] remoteproc: stm32: Improve crash recovery time Arnaud Pouliquen
2022-01-03 18:52 ` Mathieu Poirier

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.