From 9b5a973855cd261fa12fa9a727ba1d3140056472 Mon Sep 17 00:00:00 2001 From: Prakruthi Deepak Heragu Date: Tue, 4 Feb 2020 15:17:54 -0800 Subject: [PATCH] soc: qcom: Add forever loop after non-secure bite configuration The core which induces the non-secure bite should not proceed further. Non-secure bite is a secure interrupt and one of the core handles and that may not be the same core which configured the watchdog. Add forever loop after non-secure bit programming, so that core do not proceed further. Change-Id: I5523ad00d47755df6eed2bfb9210b585ee22f4ed Signed-off-by: Prasad Sodagudi Signed-off-by: Prakruthi Deepak Heragu --- drivers/soc/qcom/qcom_watchdog.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/soc/qcom/qcom_watchdog.c b/drivers/soc/qcom/qcom_watchdog.c index e652ccfe2b0b..623450a6dc0e 100644 --- a/drivers/soc/qcom/qcom_watchdog.c +++ b/drivers/soc/qcom/qcom_watchdog.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved. */ #include @@ -491,6 +491,16 @@ void msm_trigger_wdog_bite(void) __raw_readl(wdog_data->base + WDT0_EN), __raw_readl(wdog_data->base + WDT0_BARK_TIME), __raw_readl(wdog_data->base + WDT0_BITE_TIME)); + /* + * This function induces the non-secure bite and control + * should not return to the calling function. Non-secure + * bite interrupt is affined to all the cores and it may + * not be handled by the same cores which configured + * non-secure bite. So add forever loop here. + */ + while (1) + udelay(1); + } EXPORT_SYMBOL(msm_trigger_wdog_bite); @@ -510,7 +520,7 @@ static irqreturn_t wdog_bark_handler(int irq, void *dev_id) if (wdog_dd->do_ipi_ping) dump_cpu_alive_mask(wdog_dd); msm_trigger_wdog_bite(); - panic("Failed to cause a watchdog bite! - Falling back to kernel panic!"); + return IRQ_HANDLED; }