Skip to content

Commit 291803e

Browse files
Tzung-Bi Shihgregkh
authored andcommitted
remoteproc/mediatek: acknowledge watchdog IRQ after handled
[ Upstream commit 8c545f5 ] Acknowledges watchdog IRQ after handled or kernel keeps receiving the interrupt. Fixes: fd0b6c1 ("remoteproc/mediatek: Add support for mt8192 SCP") Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20210127082046.3735157-1-tzungbi@google.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent dc798d5 commit 291803e

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

‎drivers/remoteproc/mtk_common.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747

4848
#define MT8192_CORE0_SW_RSTN_CLR 0x10000
4949
#define MT8192_CORE0_SW_RSTN_SET 0x10004
50+
#define MT8192_CORE0_WDT_IRQ 0x10030
5051
#define MT8192_CORE0_WDT_CFG 0x10034
5152

5253
#define SCP_FW_VER_LEN 32

‎drivers/remoteproc/mtk_scp.c‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,17 +184,19 @@ static void mt8192_scp_irq_handler(struct mtk_scp *scp)
184184

185185
scp_to_host = readl(scp->reg_base + MT8192_SCP2APMCU_IPC_SET);
186186

187-
if (scp_to_host & MT8192_SCP_IPC_INT_BIT)
187+
if (scp_to_host & MT8192_SCP_IPC_INT_BIT) {
188188
scp_ipi_handler(scp);
189-
else
190-
scp_wdt_handler(scp, scp_to_host);
191189

192-
/*
193-
* SCP won't send another interrupt until we clear
194-
* MT8192_SCP2APMCU_IPC.
195-
*/
196-
writel(MT8192_SCP_IPC_INT_BIT,
197-
scp->reg_base + MT8192_SCP2APMCU_IPC_CLR);
190+
/*
191+
* SCP won't send another interrupt until we clear
192+
* MT8192_SCP2APMCU_IPC.
193+
*/
194+
writel(MT8192_SCP_IPC_INT_BIT,
195+
scp->reg_base + MT8192_SCP2APMCU_IPC_CLR);
196+
} else {
197+
scp_wdt_handler(scp, scp_to_host);
198+
writel(1, scp->reg_base + MT8192_CORE0_WDT_IRQ);
199+
}
198200
}
199201

200202
static irqreturn_t scp_irq_handler(int irq, void *priv)

0 commit comments

Comments
 (0)