Re: [PATCH] reboot: use make_task_dead for the halt and power off fallback
From: Andrew Morton
Date: Mon Jul 13 2026 - 21:11:58 EST
On Mon, 13 Jul 2026 06:23:32 +0000 Bradley Morgan <include@xxxxxxxxx> wrote:
> 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, the shutdown path has already disabled
> interrupts and torn down state, and do_exit() then hits its
> WARN_ON(irqs_disabled()).
Well... why are they returning? Is it both kernel_halt() and
kernel_power_off()? The report seems to indicate that
kernel_power_off() is returning.
So is there a flaw in x86 machine_power_off() which we should be
addressing?
> That is an error path, not a clean exit. Use make_task_dead() instead
> of do_exit(0): it is built for this, fixes up the irqs disabled and
> preempt state, and bounds repeated failure via oops_limit. This
> matches the make_task_dead pattern that exit.c already uses for the
> oops path.
And make_tsk_dead() is __noreturn.