[PATCH RFC] ARM: busy loop at the end of machine_power_off

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Mon Aug 20 03:52:05 EDT 2012


When machine_power_off returns the kernel panics with

	Attempted to kill init!

. So let machine_power_off busy loop as machine_halt does, too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
---
This is triggered when issuing

	poweroff

only if the machine sets the pm_power_off callback because the reboot
system call does

        if ((cmd == LINUX_REBOOT_CMD_POWER_OFF) && !pm_power_off)
		cmd = LINUX_REBOOT_CMD_HALT;

So it might even be safe to call pm_power_off unconditionally in
machine_power_off.

Best regards
Uwe

 arch/arm/kernel/process.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 693b744..eda0846 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -256,6 +256,8 @@ void machine_power_off(void)
 	machine_shutdown();
 	if (pm_power_off)
 		pm_power_off();
+	local_irq_disable();
+	while (1);
 }
 
 void machine_restart(char *cmd)
-- 
1.7.10.4




More information about the linux-arm-kernel mailing list