parisc/power: Fix power soft-off when running on qemu
authorHelge Deller <deller@gmx.de>
Fri, 17 Nov 2023 15:43:52 +0000 (16:43 +0100)
committerHelge Deller <deller@gmx.de>
Sat, 18 Nov 2023 17:59:30 +0000 (18:59 +0100)
Firmware returns the physical address of the power switch,
so need to use gsc_writel() instead of direct memory access.

Fixes: d0c219472980 ("parisc/power: Add power soft-off when running on qemu")
Signed-off-by: Helge Deller <deller@gmx.de>
Cc: stable@vger.kernel.org # v6.0+
drivers/parisc/power.c

index 539d8920c2029b2146308b45cf7650ad992f72a9..bb0d92461b08b3796df3f2b4078987291bb2f3cf 100644 (file)
@@ -176,7 +176,7 @@ static struct notifier_block parisc_panic_block = {
 static int qemu_power_off(struct sys_off_data *data)
 {
        /* this turns the system off via SeaBIOS */
-       *(int *)data->cb_data = 0;
+       gsc_writel(0, (unsigned long) data->cb_data);
        pdc_soft_power_button(1);
        return NOTIFY_DONE;
 }