Re: [PATCH 3/3] watchdog: qcom: Register pretimeout interrupt as NMI
From: Mayank Rungta
Date: Fri Jul 31 2026 - 19:55:12 EST
On Fri, Jul 31, 2026 at 7:12 AM Guenter Roeck <linux@xxxxxxxxxxxx> wrote:
>
> On 7/31/26 04:56, Konrad Dybcio wrote:
> > On 7/30/26 11:32 PM, Mayank Rungta via B4 Relay wrote:
> >> From: Mayank Rungta <mrungta@xxxxxxxxxx>
> >>
> >> When a system is completely unresponsive due to an interrupt storm or
> >> deadlocked CPU cores with standard interrupts disabled, a standard watchdog
> >> pretimeout bark interrupt will fail to execute, preventing the pretimeout
> >> governor from capturing CPU backtraces before the hardware reset bite.
> >
> > [...]
> >
> >> drivers/watchdog/qcom-wdt.c | 55 +++++++++++++++++++++++++++++++++++++++++----
> >> 1 file changed, 51 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/watchdog/qcom-wdt.c b/drivers/watchdog/qcom-wdt.c
> >> index 49bd04841f0c..19d8e91cff40 100644
> >> --- a/drivers/watchdog/qcom-wdt.c
> >> +++ b/drivers/watchdog/qcom-wdt.c
> >> @@ -51,6 +51,9 @@ struct qcom_wdt {
> >> unsigned long rate;
> >> void __iomem *base;
> >> const u32 *layout;
> >> + int irq;
> >> + bool is_nmi;
> >> + bool irq_enabled;
> >
> > Do we need to track this? I think we can rely on the framework
> > NOPing out multiple ops->start requests
> >
> Good point. Agreed.
>
> Guenter
>
Thanks for the review!
It seems you are correct. I initially added irq_enabled to guard
against duplicate starts during bootloader handoff when
qcom_wdt_is_running is true (since qcom_wdt_start() is then called
directly outside watchdog_dev). However, after inspecting
watchdog_dev.c, watchdog_start() routes bootloader handoff
(WDOG_HW_RUNNING) to .ping instead of calling ops->start() again.
I will remove `bool irq_enabled` from struct qcom_wdt in v2 since the
framework ensures enable_nmi() and disable_nmi_nosync() are always 1:1
balanced.
Thanks,
Mayank