[PATCH] reboot: halt when power off fails

Oleg Nesterov oleg at redhat.com
Wed Nov 11 12:02:38 PST 2026


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:

Acked-by: Oleg Nesterov <oleg at redhat.com>




More information about the Linux-mediatek mailing list