dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/panthor: Fix the FW reset logic
@ 2024-04-30 11:37 Boris Brezillon
  2024-05-02  8:58 ` Liviu Dudau
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Boris Brezillon @ 2024-04-30 11:37 UTC (permalink / raw)
  To: Boris Brezillon, Steven Price, Liviu Dudau, Adrián Larumbe
  Cc: dri-devel, kernel

In the post_reset function, if the fast reset didn't succeed, we
are not clearing the fast_reset flag, which prevents firmware
sections from being reloaded. While at it, use panthor_fw_stop()
instead of manually writing DISABLE to the MCU_CONTROL register.

Fixes: 2718d91816ee ("drm/panthor: Add the FW logical block")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
---
 drivers/gpu/drm/panthor/panthor_fw.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c
index 181395e2859a..fedf9627453f 100644
--- a/drivers/gpu/drm/panthor/panthor_fw.c
+++ b/drivers/gpu/drm/panthor/panthor_fw.c
@@ -1083,10 +1083,11 @@ int panthor_fw_post_reset(struct panthor_device *ptdev)
 		if (!ret)
 			goto out;
 
-		/* Force a disable, so we get a fresh boot on the next
-		 * panthor_fw_start() call.
+		/* Forcibly reset the MCU and force a slow reset, so we get a
+		 * fresh boot on the next panthor_fw_start() call.
 		 */
-		gpu_write(ptdev, MCU_CONTROL, MCU_CONTROL_DISABLE);
+		panthor_fw_stop(ptdev);
+		ptdev->fw->fast_reset = false;
 		drm_err(&ptdev->base, "FW fast reset failed, trying a slow reset");
 	}
 
-- 
2.44.0


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

* Re: [PATCH] drm/panthor: Fix the FW reset logic
  2024-04-30 11:37 [PATCH] drm/panthor: Fix the FW reset logic Boris Brezillon
@ 2024-05-02  8:58 ` Liviu Dudau
  2024-05-02  9:24 ` Steven Price
  2024-05-02 18:42 ` Boris Brezillon
  2 siblings, 0 replies; 4+ messages in thread
From: Liviu Dudau @ 2024-05-02  8:58 UTC (permalink / raw)
  To: Boris Brezillon; +Cc: Steven Price, Adrián Larumbe, dri-devel, kernel

On Tue, Apr 30, 2024 at 01:37:27PM +0200, Boris Brezillon wrote:
> In the post_reset function, if the fast reset didn't succeed, we
> are not clearing the fast_reset flag, which prevents firmware
> sections from being reloaded. While at it, use panthor_fw_stop()
> instead of manually writing DISABLE to the MCU_CONTROL register.
> 
> Fixes: 2718d91816ee ("drm/panthor: Add the FW logical block")
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>

Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>

> ---
>  drivers/gpu/drm/panthor/panthor_fw.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c
> index 181395e2859a..fedf9627453f 100644
> --- a/drivers/gpu/drm/panthor/panthor_fw.c
> +++ b/drivers/gpu/drm/panthor/panthor_fw.c
> @@ -1083,10 +1083,11 @@ int panthor_fw_post_reset(struct panthor_device *ptdev)
>  		if (!ret)
>  			goto out;
>  
> -		/* Force a disable, so we get a fresh boot on the next
> -		 * panthor_fw_start() call.
> +		/* Forcibly reset the MCU and force a slow reset, so we get a
> +		 * fresh boot on the next panthor_fw_start() call.
>  		 */
> -		gpu_write(ptdev, MCU_CONTROL, MCU_CONTROL_DISABLE);
> +		panthor_fw_stop(ptdev);
> +		ptdev->fw->fast_reset = false;
>  		drm_err(&ptdev->base, "FW fast reset failed, trying a slow reset");
>  	}
>  
> -- 
> 2.44.0
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

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

* Re: [PATCH] drm/panthor: Fix the FW reset logic
  2024-04-30 11:37 [PATCH] drm/panthor: Fix the FW reset logic Boris Brezillon
  2024-05-02  8:58 ` Liviu Dudau
@ 2024-05-02  9:24 ` Steven Price
  2024-05-02 18:42 ` Boris Brezillon
  2 siblings, 0 replies; 4+ messages in thread
From: Steven Price @ 2024-05-02  9:24 UTC (permalink / raw)
  To: Boris Brezillon, Liviu Dudau, Adrián Larumbe; +Cc: dri-devel, kernel

On 30/04/2024 12:37, Boris Brezillon wrote:
> In the post_reset function, if the fast reset didn't succeed, we
> are not clearing the fast_reset flag, which prevents firmware
> sections from being reloaded. While at it, use panthor_fw_stop()
> instead of manually writing DISABLE to the MCU_CONTROL register.
> 
> Fixes: 2718d91816ee ("drm/panthor: Add the FW logical block")
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>

Reviewed-by: Steven Price <steven.price@arm.com>

> ---
>  drivers/gpu/drm/panthor/panthor_fw.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c
> index 181395e2859a..fedf9627453f 100644
> --- a/drivers/gpu/drm/panthor/panthor_fw.c
> +++ b/drivers/gpu/drm/panthor/panthor_fw.c
> @@ -1083,10 +1083,11 @@ int panthor_fw_post_reset(struct panthor_device *ptdev)
>  		if (!ret)
>  			goto out;
>  
> -		/* Force a disable, so we get a fresh boot on the next
> -		 * panthor_fw_start() call.
> +		/* Forcibly reset the MCU and force a slow reset, so we get a
> +		 * fresh boot on the next panthor_fw_start() call.
>  		 */
> -		gpu_write(ptdev, MCU_CONTROL, MCU_CONTROL_DISABLE);
> +		panthor_fw_stop(ptdev);
> +		ptdev->fw->fast_reset = false;
>  		drm_err(&ptdev->base, "FW fast reset failed, trying a slow reset");
>  	}
>  


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

* Re: [PATCH] drm/panthor: Fix the FW reset logic
  2024-04-30 11:37 [PATCH] drm/panthor: Fix the FW reset logic Boris Brezillon
  2024-05-02  8:58 ` Liviu Dudau
  2024-05-02  9:24 ` Steven Price
@ 2024-05-02 18:42 ` Boris Brezillon
  2 siblings, 0 replies; 4+ messages in thread
From: Boris Brezillon @ 2024-05-02 18:42 UTC (permalink / raw)
  To: Boris Brezillon, Steven Price, Liviu Dudau, Adrián Larumbe
  Cc: dri-devel, kernel

On Tue, 30 Apr 2024 13:37:27 +0200
Boris Brezillon <boris.brezillon@collabora.com> wrote:

> In the post_reset function, if the fast reset didn't succeed, we
> are not clearing the fast_reset flag, which prevents firmware
> sections from being reloaded. While at it, use panthor_fw_stop()
> instead of manually writing DISABLE to the MCU_CONTROL register.
> 
> Fixes: 2718d91816ee ("drm/panthor: Add the FW logical block")
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>

Queued to drm-misc-next-fixes.

> ---
>  drivers/gpu/drm/panthor/panthor_fw.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c
> index 181395e2859a..fedf9627453f 100644
> --- a/drivers/gpu/drm/panthor/panthor_fw.c
> +++ b/drivers/gpu/drm/panthor/panthor_fw.c
> @@ -1083,10 +1083,11 @@ int panthor_fw_post_reset(struct panthor_device *ptdev)
>  		if (!ret)
>  			goto out;
>  
> -		/* Force a disable, so we get a fresh boot on the next
> -		 * panthor_fw_start() call.
> +		/* Forcibly reset the MCU and force a slow reset, so we get a
> +		 * fresh boot on the next panthor_fw_start() call.
>  		 */
> -		gpu_write(ptdev, MCU_CONTROL, MCU_CONTROL_DISABLE);
> +		panthor_fw_stop(ptdev);
> +		ptdev->fw->fast_reset = false;
>  		drm_err(&ptdev->base, "FW fast reset failed, trying a slow reset");
>  	}
>  


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

end of thread, other threads:[~2024-05-02 18:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-30 11:37 [PATCH] drm/panthor: Fix the FW reset logic Boris Brezillon
2024-05-02  8:58 ` Liviu Dudau
2024-05-02  9:24 ` Steven Price
2024-05-02 18:42 ` Boris Brezillon

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