summaryrefslogtreecommitdiff
path: root/drivers/soc
diff options
context:
space:
mode:
authorSubbaraman Narayanamurthy <subbaram@codeaurora.org>2014-08-06 14:06:33 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:02:15 -0700
commitaff6914761d2f449aaec92ebc43ad15499640d12 (patch)
tree4b598547fa5668a595d12dfb877b0ac219483446 /drivers/soc
parent96864fd7edce57e2e3c06b0f1ee4a56a8eb8018f (diff)
soc: qcom: watchdog_v2: Add support to trigger watchdog bite on panic
In certain cases during a kernel panic,the interrupts on non-panicking CPUs are disabled. Since CPU context cannot be collected by sending IPI to those CPUs, we're limited to debug the problem. Forcing a watchdog bite during kernel panic will ensure us getting the proper CPU context. Hence adding support for the same. Change-Id: Id06030d9bc46d94209da7f0ef8c47bfd3477baf6 Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org> [abhimany: resolve trivial merge conflicts] Signed-off-by: Abhimanyu Kapur <abhimany@codeaurora.org>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/qcom/Kconfig8
-rw-r--r--drivers/soc/qcom/watchdog_v2.c14
2 files changed, 10 insertions, 12 deletions
diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
index 12ce797383e7..e25a37e7ecd5 100644
--- a/drivers/soc/qcom/Kconfig
+++ b/drivers/soc/qcom/Kconfig
@@ -230,3 +230,11 @@ config TRACER_PKT
Tracer Packet helps in profiling the performance of inter-
processor communication protocols. The profiling information
can be logged into the tracer packet itself.
+
+config QCOM_FORCE_WDOG_BITE_ON_PANIC
+ bool "QCOM force watchdog bite"
+ depends on QCOM_WATCHDOG_V2
+ help
+ This forces a watchdog bite when the device restarts due to a
+ kernel panic. On certain MSM SoCs, this provides us
+ additional debugging information.
diff --git a/drivers/soc/qcom/watchdog_v2.c b/drivers/soc/qcom/watchdog_v2.c
index 6bef39edc003..6ea51140da28 100644
--- a/drivers/soc/qcom/watchdog_v2.c
+++ b/drivers/soc/qcom/watchdog_v2.c
@@ -28,6 +28,7 @@
#include <linux/platform_device.h>
#include <soc/qcom/scm.h>
#include <soc/qcom/memory_dump.h>
+#include <soc/qcom/watchdog.h>
#define MODULE_NAME "msm_watchdog"
#define WDT0_ACCSCSSNBARK_INT 0
@@ -406,18 +407,7 @@ static irqreturn_t wdog_bark_handler(int irq, void *dev_id)
wdog_dd->last_pet, nanosec_rem / 1000);
if (wdog_dd->do_ipi_ping)
dump_cpu_alive_mask(wdog_dd);
- printk(KERN_INFO "Causing a watchdog bite!");
- __raw_writel(1, wdog_dd->base + WDT0_BITE_TIME);
- mb();
- __raw_writel(1, wdog_dd->base + WDT0_RST);
- mb();
- /* Delay to make sure bite occurs */
- mdelay(1);
- pr_err("Wdog - STS: 0x%x, CTL: 0x%x, BARK TIME: 0x%x, BITE TIME: 0x%x",
- __raw_readl(wdog_dd->base + WDT0_STS),
- __raw_readl(wdog_dd->base + WDT0_EN),
- __raw_readl(wdog_dd->base + WDT0_BARK_TIME),
- __raw_readl(wdog_dd->base + WDT0_BITE_TIME));
+ msm_trigger_wdog_bite();
panic("Failed to cause a watchdog bite! - Falling back to kernel panic!");
return IRQ_HANDLED;
}