Re: [PATCH] reboot: enable IRQs before do_exit in the halt and power off fallback
From: Oleg Nesterov
Date: Mon Jul 13 2026 - 15:51:00 EST
On 07/12, Eric W. Biederman wrote:
>
> Bradley Morgan <include@xxxxxxxxx> writes:
>
> > The reboot syscall calls do_exit(0) after kernel_halt() or
> > kernel_power_off(). Those are expected to stop the machine and not
> > return. When they do return (no PM info, power off failed), the
> > shutdown path has already disabled interrupts: native_machine_shutdown()
> > calls local_irq_disable() on x86, and do_exit() then hits its
> > WARN_ON(irqs_disabled()) at kernel/exit.c:930.
> >
> > do_exit only warns by design; make_task_dead() is the path that fixes
> > the IRQs disabled state (commit 001c28e57187 ("exit: Detect and fix irq
> > disabled state in oops")). The reboot fallback is not an oops and wants
> > a clean do_exit, so enable IRQs at the two call sites instead, matching
> > the make_task_dead pattern.
>
> I think this is fixing symptoms not the actual cause.
>
> How does kernel_halt or kernel_power_off manage to return?
Agreed... and this was already reported twice at least. See
https://lore.kernel.org/all/20250403-exit-v1-1-8e9266bfc4b7@xxxxxxxxxx/
https://lore.kernel.org/all/20250410143937.1829272-1-Tze-nan.Wu@xxxxxxxxxxxx/
Oleg.