[PATCH v17 12/14] remoteproc: mediatek: Report watchdog crash to all cores

Tinghan Shen posted 14 patches 1 year, 2 months ago
[PATCH v17 12/14] remoteproc: mediatek: Report watchdog crash to all cores
Posted by Tinghan Shen 1 year, 2 months ago
To ensure consistent behavior, the watchdog timeout handling of the
multi-core SCP should reset the whole SCP sub-system when watchdog
timeout. Triggering the rproc recovery flow on all instances will
ensure proper recovery of the SCP sub-system.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
---
 drivers/remoteproc/mtk_scp.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
index 49b2ca2b30b3..37ee5e6286ee 100644
--- a/drivers/remoteproc/mtk_scp.c
+++ b/drivers/remoteproc/mtk_scp.c
@@ -68,8 +68,14 @@ EXPORT_SYMBOL_GPL(scp_put);
 
 static void scp_wdt_handler(struct mtk_scp *scp, u32 scp_to_host)
 {
+	struct mtk_scp_of_cluster *scp_cluster = scp->cluster;
+	struct mtk_scp *scp_node;
+
 	dev_err(scp->dev, "SCP watchdog timeout! 0x%x", scp_to_host);
-	rproc_report_crash(scp->rproc, RPROC_WATCHDOG);
+
+	/* report watchdog timeout to all cores */
+	list_for_each_entry(scp_node, &scp_cluster->mtk_scp_list, elem)
+		rproc_report_crash(scp_node->rproc, RPROC_WATCHDOG);
 }
 
 static void scp_init_ipi_handler(void *data, unsigned int len, void *priv)
-- 
2.18.0
Re: [PATCH v17 12/14] remoteproc: mediatek: Report watchdog crash to all cores
Posted by AngeloGioacchino Del Regno 1 year, 2 months ago
Il 01/09/23 10:09, Tinghan Shen ha scritto:
> To ensure consistent behavior, the watchdog timeout handling of the
> multi-core SCP should reset the whole SCP sub-system when watchdog
> timeout. Triggering the rproc recovery flow on all instances will
> ensure proper recovery of the SCP sub-system.
> 
> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>