Re: [PATCH 3/3] watchdog: realtek-otto: add RTL9607C support
Sander Vanheule <[email protected]> Sun, 17 May 2026 12:39:52 +0200
| Newsgroups | dev.linux.lists.sashiko,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-watchdog |
|---|---|
| Message-ID | <[email protected]> |
On Sat, 2026-05-09 at 17:27 +0000, [email protected] wrote: > Also, does the system restart handler sleep in an atomic context? > > otto_wdt_restart() { > [ ... ] > disable_irq(ctrl->irq_phase1); > [ ... ] > } > > The otto_wdt_restart() function is a system restart handler executed in an > atomic context with local interrupts disabled. Since disable_irq() internally > invokes synchronize_irq(), which uses wait_event() to wait for executing > interrupt handlers to finish, it can sleep. > > Calling a sleeping function with local interrupts disabled triggers a kernel > panic, and waiting for an IRQ handler to complete while other CPUs are stopped > during a machine restart can result in a hard deadlock. Should this use > disable_irq_nosync() instead? I figured if local interrupts are disabled, then we don't need to disable the pretimeout interrupt, since it won't get called (and give confusing warnings). However, doing so results in the output of the pretimeout interrupt handler being printed when rebooting the system (single-core CPU, both with SMP and without), so the interrupt is still getting through. Am I missing something here? Or is this a false positive? Best, Sander