mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: mali-c55: fail power-on when safe stop times out
@ 2026-08-30 13:46 Pengpeng Hou
  2026-09-30 15:42 ` Jacopo Mondi
  0 siblings, 1 reply; 2+ messages in thread
From: Pengpeng Hou @ 2026-08-30 13:46 UTC (permalink / raw)
  To: Daniel Scally
  Cc: Pengpeng Hou, Jacopo Mondi, Mauro Carvalho Chehab, linux-media,
	linux-kernel

The power-on path requests safe stop to establish a non-streaming state but
ignores the polling result and publishes runtime resume success.

Power the block back off and propagate a safe-stop timeout.

Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
---
 drivers/media/platform/arm/mali-c55/mali-c55-core.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-core.c b/drivers/media/platform/arm/mali-c55/mali-c55-core.c
index f28e9f4354aca..288fba4831808 100644
--- a/drivers/media/platform/arm/mali-c55/mali-c55-core.c
+++ b/drivers/media/platform/arm/mali-c55/mali-c55-core.c
@@ -730,8 +730,13 @@ static int __mali_c55_power_on(struct mali_c55 *mali_c55)
 	/* Set safe stop to ensure we're in a non-streaming state */
 	mali_c55_write(mali_c55, MALI_C55_REG_INPUT_MODE_REQUEST,
 		       MALI_C55_INPUT_SAFE_STOP);
-	readl_poll_timeout(mali_c55->base + MALI_C55_REG_MODE_STATUS,
-			   val, !val, 10 * USEC_PER_MSEC, 250 * USEC_PER_MSEC);
+	ret = readl_poll_timeout(mali_c55->base + MALI_C55_REG_MODE_STATUS,
+				 val, !val, 10 * USEC_PER_MSEC, 250 * USEC_PER_MSEC);
+	if (ret) {
+		dev_err(mali_c55->dev, "safe stop timed out\n");
+		__mali_c55_power_off(mali_c55);
+		return ret;
+	}
 
 	return 0;
 }

base-commit: 08dbfad3f5040f5bdb6c529da20d6d4e81fefd72
-- 
2.50.1


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

* Re: [PATCH] media: mali-c55: fail power-on when safe stop times out
  2026-08-30 13:46 [PATCH] media: mali-c55: fail power-on when safe stop times out Pengpeng Hou
@ 2026-09-30 15:42 ` Jacopo Mondi
  0 siblings, 0 replies; 2+ messages in thread
From: Jacopo Mondi @ 2026-09-30 15:42 UTC (permalink / raw)
  To: Pengpeng Hou
  Cc: Daniel Scally, Jacopo Mondi, Mauro Carvalho Chehab, linux-media,
	linux-kernel

Hello Pengpeng

On Sun, Aug 30, 2026 at 09:46:09PM +0800, Pengpeng Hou wrote:
> The power-on path requests safe stop to establish a non-streaming state but
> ignores the polling result and publishes runtime resume success.
>
> Power the block back off and propagate a safe-stop timeout.
>
> Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver")

I'll add
Cc: stable@vger.kernel.org

> Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>

Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> ---
>  drivers/media/platform/arm/mali-c55/mali-c55-core.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-core.c b/drivers/media/platform/arm/mali-c55/mali-c55-core.c
> index f28e9f4354aca..288fba4831808 100644
> --- a/drivers/media/platform/arm/mali-c55/mali-c55-core.c
> +++ b/drivers/media/platform/arm/mali-c55/mali-c55-core.c
> @@ -730,8 +730,13 @@ static int __mali_c55_power_on(struct mali_c55 *mali_c55)
>  	/* Set safe stop to ensure we're in a non-streaming state */
>  	mali_c55_write(mali_c55, MALI_C55_REG_INPUT_MODE_REQUEST,
>  		       MALI_C55_INPUT_SAFE_STOP);
> -	readl_poll_timeout(mali_c55->base + MALI_C55_REG_MODE_STATUS,
> -			   val, !val, 10 * USEC_PER_MSEC, 250 * USEC_PER_MSEC);
> +	ret = readl_poll_timeout(mali_c55->base + MALI_C55_REG_MODE_STATUS,
> +				 val, !val, 10 * USEC_PER_MSEC, 250 * USEC_PER_MSEC);
> +	if (ret) {
> +		dev_err(mali_c55->dev, "safe stop timed out\n");
> +		__mali_c55_power_off(mali_c55);
> +		return ret;
> +	}
>
>  	return 0;
>  }
>
> base-commit: 08dbfad3f5040f5bdb6c529da20d6d4e81fefd72
> --
> 2.50.1
>
>

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

end of thread, other threads:[~2026-09-30 15:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-30 13:46 [PATCH] media: mali-c55: fail power-on when safe stop times out Pengpeng Hou
2026-09-30 15:42 ` Jacopo Mondi

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®