]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
parisc: Allow to reboot machine after system halt
authorHelge Deller <deller@gmx.de>
Mon, 22 May 2023 20:57:30 +0000 (22:57 +0200)
committerHelge Deller <deller@gmx.de>
Wed, 24 May 2023 13:46:12 +0000 (15:46 +0200)
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>
arch/parisc/kernel/process.c

index 97c6f875bd0e12f188215afa07815356711593f5..24411ab79c307d4ab78f33303a7b1d8afb7d1c1d 100644 (file)
@@ -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);