# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/linux/hotfix-sunw-poweroff.patch # Copyright (C) 2023 The T2 SDE Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License version 2 as used by the T2 SDE. # --- T2-COPYRIGHT-NOTE-END --- Instead of open coding an inf. loop around prom power-off and reboot, let's reuse machine_halt so we get to see an actual error (panic) if it ever fails. Signed-off-by: René Rebe --- linux-6.5/arch/sparc/include/asm/oplib_64.h.vanilla 2023-09-07 13:11:02.018226643 +0200 +++ linux-6.5/arch/sparc/include/asm/oplib_64.h 2023-09-07 13:11:21.690225350 +0200 @@ -85,10 +85,10 @@ /* Enter the prom, with no chance of continuation for the stand-alone * which calls this. */ -void prom_halt(void) __attribute__ ((noreturn)); +void prom_halt(void); /* Halt and power-off the machine. */ -void prom_halt_power_off(void) __attribute__ ((noreturn)); +void prom_halt_power_off(void); /* Acquire the IDPROM of the root node in the prom device tree. This * gets passed a buffer where you would like it stuffed. The return value --- linux-6.5/arch/sparc/prom/misc_64.c.old 2023-08-27 23:49:51.000000000 +0200 +++ linux-6.5/arch/sparc/prom/misc_64.c 2023-09-02 22:52:06.515405612 +0200 @@ -120,12 +120,10 @@ 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 */ } void prom_halt_power_off(void) @@ -140,9 +138,6 @@ args[1] = 0; args[2] = 0; p1275_cmd_direct(args); - - /* if nothing else helps, we just halt */ - prom_halt(); } /* Get the idprom and stuff it into buffer 'idbuf'. Returns the --- linux-6.5/arch/sparc/kernel/reboot.c.old 2023-08-27 23:49:51.000000000 +0200 +++ linux-6.5/arch/sparc/kernel/reboot.c 2023-09-02 22:53:54.458398515 +0200 @@ -29,7 +29,7 @@ if (!of_node_is_type(of_console_device, "serial") || scons_pwroff) prom_halt_power_off(); - prom_halt(); + machine_halt(); } void machine_halt(void)