linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] remoteproc: mediatek: Add SCP watchdog handler in IRQ processing
@ 2025-05-21 14:24 Wentao Liang
  2025-05-21 16:48 ` Markus Elfring
  2025-05-22 14:47 ` Mathieu Poirier
  0 siblings, 2 replies; 3+ messages in thread
From: Wentao Liang @ 2025-05-21 14:24 UTC (permalink / raw)
  To: andersson, mathieu.poirier, matthias.bgg,
	angelogioacchino.delregno
  Cc: linux-remoteproc, linux-arm-kernel, linux-mediatek, linux-kernel,
	Wentao Liang, stable

In mt8195_scp_c1_irq_handler(), only the IPC interrupt bit
(MT8192_SCP_IPC_INT_BIT) was checked., but does not handle
when this bit is not set. This could lead to unhandled watchdog
events. This could lead to unhandled watchdog events. A proper
implementation can be found in mt8183_scp_irq_handler().

Add a new branch to handle SCP watchdog events when the IPC
interrupt bit is not set.

Fixes: 6a1c9aaf04eb ("remoteproc: mediatek: Add MT8195 SCP core 1 operations")
Cc: stable@vger.kernel.org # v6.7
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/remoteproc/mtk_scp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
index 0f4a7065d0bd..316e8c98a503 100644
--- a/drivers/remoteproc/mtk_scp.c
+++ b/drivers/remoteproc/mtk_scp.c
@@ -273,6 +273,8 @@ static void mt8195_scp_c1_irq_handler(struct mtk_scp *scp)
 
 	if (scp_to_host & MT8192_SCP_IPC_INT_BIT)
 		scp_ipi_handler(scp);
+	else
+		scp_wdt_handler(scp, scp_to_host);
 
 	writel(scp_to_host, scp->cluster->reg_base + MT8195_SSHUB2APMCU_IPC_CLR);
 }
-- 
2.42.0.windows.2



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

* Re: [PATCH] remoteproc: mediatek: Add SCP watchdog handler in IRQ processing
  2025-05-21 14:24 [PATCH] remoteproc: mediatek: Add SCP watchdog handler in IRQ processing Wentao Liang
@ 2025-05-21 16:48 ` Markus Elfring
  2025-05-22 14:47 ` Mathieu Poirier
  1 sibling, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2025-05-21 16:48 UTC (permalink / raw)
  To: vulab, linux-remoteproc, linux-mediatek, linux-arm-kernel
  Cc: stable, LKML, Angelo Gioacchino Del Regno, Bjorn Andersson,
	Mathieu Poirier, Matthias Brugger

> In mt8195_scp_c1_irq_handler(), only the IPC interrupt bit
> (MT8192_SCP_IPC_INT_BIT) was checked., but does not handle
> when this bit is not set. This could lead to unhandled watchdog
> events. This could lead to unhandled watchdog events. A proper
…

* You may occasionally put more than 63 characters into text lines
  of such a change description.

* Please avoid a duplicate sentence here.


Regards,
Markus


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

* Re: [PATCH] remoteproc: mediatek: Add SCP watchdog handler in IRQ processing
  2025-05-21 14:24 [PATCH] remoteproc: mediatek: Add SCP watchdog handler in IRQ processing Wentao Liang
  2025-05-21 16:48 ` Markus Elfring
@ 2025-05-22 14:47 ` Mathieu Poirier
  1 sibling, 0 replies; 3+ messages in thread
From: Mathieu Poirier @ 2025-05-22 14:47 UTC (permalink / raw)
  To: Wentao Liang
  Cc: andersson, matthias.bgg, angelogioacchino.delregno,
	linux-remoteproc, linux-arm-kernel, linux-mediatek, linux-kernel,
	stable

Good day,

On Wed, May 21, 2025 at 10:24:03PM +0800, Wentao Liang wrote:
> In mt8195_scp_c1_irq_handler(), only the IPC interrupt bit
> (MT8192_SCP_IPC_INT_BIT) was checked., but does not handle
> when this bit is not set. This could lead to unhandled watchdog
> events. This could lead to unhandled watchdog events. A proper
> implementation can be found in mt8183_scp_irq_handler().
>

As pointed out by Markus, this changelog needs work.

> Add a new branch to handle SCP watchdog events when the IPC
> interrupt bit is not set.
> 
> Fixes: 6a1c9aaf04eb ("remoteproc: mediatek: Add MT8195 SCP core 1 operations")
> Cc: stable@vger.kernel.org # v6.7
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
>  drivers/remoteproc/mtk_scp.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
> index 0f4a7065d0bd..316e8c98a503 100644
> --- a/drivers/remoteproc/mtk_scp.c
> +++ b/drivers/remoteproc/mtk_scp.c
> @@ -273,6 +273,8 @@ static void mt8195_scp_c1_irq_handler(struct mtk_scp *scp)
>  
>  	if (scp_to_host & MT8192_SCP_IPC_INT_BIT)
>  		scp_ipi_handler(scp);
> +	else
> +		scp_wdt_handler(scp, scp_to_host);

I would much rather see a test for the watchdog bit than just assuming it is
a watchdog interrupt.  And while at it, please refactor the bit definition to be
platform agnostic rather than reusing 8192 definitions on an 8195 platform.

Thanks,
Mathieu

>  
>  	writel(scp_to_host, scp->cluster->reg_base + MT8195_SSHUB2APMCU_IPC_CLR);
>  }
> -- 
> 2.42.0.windows.2
> 


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

end of thread, other threads:[~2025-05-22 15:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-21 14:24 [PATCH] remoteproc: mediatek: Add SCP watchdog handler in IRQ processing Wentao Liang
2025-05-21 16:48 ` Markus Elfring
2025-05-22 14:47 ` Mathieu Poirier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).