Skip to contentSkip to conversation

sparc64: shut down to OBP correctly

PATCH Superseded Larry Bassel 2 participants 2 messages Dec 21, 2016 SPARC + UltraSPARC (sparc/sparc64)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 sparc64: shut down to OBP correctly

The command "shutdown -h -H now" should shut down the system to OBP, however the machine was incorrectly being powered off instead (on both LDOM and bare metal).

The "exit" command to the OBP must be run and then a hard loop to prevent return to the kernel.

---
 arch/sparc/prom/misc_64.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
arch/sparc/prom/misc_64.c +1 -6
index 53a696d..aa80788 100644
@@ -115,16 +115,11 @@ void notrace prom_halt(void)
 {
 	unsigned long args[3];
 
-#ifdef CONFIG_SUN_LDOMS
-	if (ldom_domaining_enabled)
-		ldom_power_off();
-#endif
-again:
 	args[0] = (unsigned long) "exit";
 	args[1] = 0;
 	args[2] = 0;
 	p1275_cmd_direct(args);
-	goto again; /* PROM is out to get me -DaveM */
+	while (1);
 }
 
 void prom_halt_power_off(void)
Signature · 1 line
1.7.1
#1 lore raw

Hi Larry.

Little nitpick...

arch/sparc/prom/misc_64.c void notrace prom_halt(void) · line 122

Quoted 4 lines
arch/sparc/prom/misc_64.c +1 -1
 	args[2] = 0;
 	p1275_cmd_direct(args);
-	goto again; /* PROM is out to get me -DaveM */
+	while (1);

If you write this like:

	for (;;)
		/* forever */;

It is much more obvious that this is supposed to loop forever. As it is now it more looks like an oversight.

Sam