From f849f43abcb579ec1bb8f8a1d0adc78aab3c8d47 Mon Sep 17 00:00:00 2001 From: Kathiravan Thirumoorthy Date: Mon, 20 Nov 2023 09:22:38 +0530 Subject: [PATCH] watchdog: qcom: add prints for watchdog status With this patch, we get the below information during the WDT bark [ 103.022553] watchdog0: pretimeout event [ 103.022569] Watchdog bark! Now = 103.022552 [ 103.025176] Waiting for Reboot Change-Id: Ib743926bf7d9d1d3ec894492ebb76caa94c50c15 Signed-off-by: Kathiravan Thirumoorthy --- drivers/watchdog/qcom-wdt.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/watchdog/qcom-wdt.c b/drivers/watchdog/qcom-wdt.c index 0d2209c5eaca..da0d7b3f124c 100644 --- a/drivers/watchdog/qcom-wdt.c +++ b/drivers/watchdog/qcom-wdt.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -65,9 +66,16 @@ struct qcom_wdt *to_qcom_wdt(struct watchdog_device *wdd) static irqreturn_t qcom_wdt_isr(int irq, void *arg) { struct watchdog_device *wdd = arg; + unsigned long nanosec_rem; + unsigned long long t = sched_clock(); watchdog_notify_pretimeout(wdd); + nanosec_rem = do_div(t, 1000000000); + pr_info("Watchdog bark! Now = %lu.%06lu\n", (unsigned long) t, + nanosec_rem / 1000); + pr_info("Waiting for Reboot\n"); + return IRQ_HANDLED; } -- 2.34.1