[PATCH] reboot: halt when power off fails

Breno Leitao leitao at debian.org
Thu Nov 12 01:33:22 PST 2026


On Wed, Nov 11, 2026 at 09:02:38PM +0100, Oleg Nesterov wrote:
> On 11/10, Breno Leitao wrote:
> >
> > --- a/kernel/reboot.c
> > +++ b/kernel/reboot.c
> > @@ -791,6 +791,9 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
> >
> >  	case LINUX_REBOOT_CMD_POWER_OFF:
> >  		kernel_power_off();
> > +		pr_emerg("Power off failed: System halted instead\n");
> > +		/* kernel_power_off() already ran the shutdown, only halt. */
> > +		machine_halt();
> 
> Agreed. Even if I don't think my ack has any value in this area:

Thanks, Oleg.

I tried to find out who merges changes to this file and it is not clear.
akpm seems to be the closest, as most of the changes went through him,
and somehow he was not CCed here. :-|

Andrew, would you be willing to take this one?

thanks,
--breno



More information about the Linux-mediatek mailing list