Re: [PATCH 3/3] watchdog: qcom: Register pretimeout interrupt as NMI
From: Doug Anderson
Date: Thu Jul 30 2026 - 17:54:14 EST
Hi,
On Thu, Jul 30, 2026 at 2:33 PM Mayank Rungta via B4 Relay
<devnull+mrungta.google.com@xxxxxxxxxx> 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.
>
> Attempt to register the pretimeout interrupt as an NMI (or pseudo-NMI)
> using request_nmi(). If NMI registration fails due to lack of platform
> GIC pseudo-NMI support, fall back to devm_request_irq().
>
> Explicitly arm and disarm the NMI during watchdog start and stop operations
> using enable_nmi() and disable_nmi_nosync().
>
> NMI Execution Call Trace (lkdtm HARDLOCKUP freeze break):
> Kernel panic - not syncing: watchdog pretimeout event
> CPU: 0 UID: 0 PID: 5419 Comm: bash Not tainted 6.19.0-rc5-00022
> Hardware name: Google CoachZ (rev3+) (DT)
> Call trace:
> show_stack+0x24/0x34 (C)
> dump_stack_lvl+0x84/0xac
> dump_stack+0x1c/0x34
> vpanic+0xfc/0x2d0
> panic+0x6c/0x74
> watchdog_notify_pretimeout+0x34/0x48
> qcom_wdt_isr+0x20/0x34
> handle_fasteoi_nmi+0x50/0x88
> handle_irq_desc+0x4c/0x68
> generic_handle_domain_nmi+0x38/0x48
> __gic_handle_nmi.isra.0+0x40/0x90
> gic_handle_irq+0x64/0x234
> call_on_irq_stack+0x48/0x88
> do_interrupt_handler+0x74/0xc4
> el1_interrupt+0x5c/0xb0
> lkdtm_HARDLOCKUP+0x18/0x28 (P)
>
> Signed-off-by: Mayank Rungta <mrungta@xxxxxxxxxx>
> ---
> drivers/watchdog/qcom-wdt.c | 55 +++++++++++++++++++++++++++++++++++++++++----
> 1 file changed, 51 insertions(+), 4 deletions(-)
I pre-reviewed this for Mayank and it looks reasonable to me.
Reviewed-by: Douglas Anderson <dianders@xxxxxxxxxxxx>