1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/linux/hotfix-sunw-poweroff.patch
3 # Copyright (C) 2023 The T2 SDE Project
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
8 # This patch file is dual-licensed. It is available under the license the
9 # patched project is licensed under, as long as it is an OpenSource license
10 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
11 # of the GNU General Public License version 2 as used by the T2 SDE.
12 # --- T2-COPYRIGHT-NOTE-END ---
14 Instead of open coding an inf. loop around prom power-off and reboot,
15 let's reuse machine_halt so we get to see an actual error (panic) if
18 Signed-off-by: René Rebe <rene@exactcode.de>
20 --- linux-6.5/arch/sparc/include/asm/oplib_64.h.vanilla 2023-09-07 13:11:02.018226643 +0200
21 +++ linux-6.5/arch/sparc/include/asm/oplib_64.h 2023-09-07 13:11:21.690225350 +0200
23 /* Enter the prom, with no chance of continuation for the stand-alone
26 -void prom_halt(void) __attribute__ ((noreturn));
27 +void prom_halt(void);
29 /* Halt and power-off the machine. */
30 -void prom_halt_power_off(void) __attribute__ ((noreturn));
31 +void prom_halt_power_off(void);
33 /* Acquire the IDPROM of the root node in the prom device tree. This
34 * gets passed a buffer where you would like it stuffed. The return value
35 --- linux-6.5/arch/sparc/prom/misc_64.c.old 2023-08-27 23:49:51.000000000 +0200
36 +++ linux-6.5/arch/sparc/prom/misc_64.c 2023-09-02 22:52:06.515405612 +0200
38 if (ldom_domaining_enabled)
42 args[0] = (unsigned long) "exit";
45 p1275_cmd_direct(args);
46 - goto again; /* PROM is out to get me -DaveM */
49 void prom_halt_power_off(void)
53 p1275_cmd_direct(args);
55 - /* if nothing else helps, we just halt */
59 /* Get the idprom and stuff it into buffer 'idbuf'. Returns the
60 --- linux-6.5/arch/sparc/kernel/reboot.c.old 2023-08-27 23:49:51.000000000 +0200
61 +++ linux-6.5/arch/sparc/kernel/reboot.c 2023-09-02 22:53:54.458398515 +0200
63 if (!of_node_is_type(of_console_device, "serial") || scons_pwroff)
64 prom_halt_power_off();
70 void machine_halt(void)