DORMANTno replies

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

From: Uwe Kleine-König <hidden>
Date: 2012-08-20 07:52:05
Subsystem: arm port, the rest · Maintainers: Russell King, Linus Torvalds

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 <redacted>
---
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help