summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2023-05-22 22:57:30 +0200
committerHelge Deller <deller@gmx.de>2023-05-24 15:46:12 +0200
commit2028315cf59bb899a5ac7e87dc48ecb8fac7ac24 (patch)
tree5df5b9116b894765b46816a6c5e8e3126e75de9f /arch
parentparisc: Enable LOCKDEP support (diff)
downloadlinux-2028315cf59bb899a5ac7e87dc48ecb8fac7ac24.tar.xz
linux-2028315cf59bb899a5ac7e87dc48ecb8fac7ac24.zip
parisc: Allow to reboot machine after system halt
In case a machine can't power-off itself on system shutdown, allow the user to reboot it by pressing the RETURN key. Cc: <stable@vger.kernel.org> # v4.14+ Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/parisc/kernel/process.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index 97c6f875bd0e..24411ab79c30 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -122,13 +122,18 @@ void machine_power_off(void)
/* It seems we have no way to power the system off via
* software. The user has to press the button himself. */
- printk(KERN_EMERG "System shut down completed.\n"
- "Please power this system off now.");
+ printk("Power off or press RETURN to reboot.\n");
/* prevent soft lockup/stalled CPU messages for endless loop. */
rcu_sysrq_start();
lockup_detector_soft_poweroff();
- for (;;);
+ while (1) {
+ /* reboot if user presses RETURN key */
+ if (pdc_iodc_getc() == 13) {
+ printk("Rebooting...\n");
+ machine_restart(NULL);
+ }
+ }
}
void (*pm_power_off)(void);