summary refs log tree commit diff stats
path: root/hw/rtc
diff options
context:
space:
mode:
authorAbhiram Tilak <atp.exp@gmail.com>2024-02-26 14:07:23 +0000
committerPeter Maydell <peter.maydell@linaro.org>2024-02-27 13:01:41 +0000
commit9d80aa04832a5ec342f31a6bfea50b9245110139 (patch)
treecebe1fdb4b6529c22eb8222742edcc90ceb8b2ec /hw/rtc
parent9d19a8ffcc253383f73850f6a61f04d7940f8cb6 (diff)
downloadfocaccia-qemu-9d80aa04832a5ec342f31a6bfea50b9245110139.tar.gz
focaccia-qemu-9d80aa04832a5ec342f31a6bfea50b9245110139.zip
misc: m48t59: replace qemu_system_reset_request() call with watchdog_perform_action()
A few watchdog devices use qemu_system_reset_request(). This is not ideal since
behaviour of watchdog-expiry can't be changed by QMP using `watchdog_action`.
As stated in BiteSizedTasks wiki page, instead of using qemu_system_reset_request()
to reset when a watchdog timer expires, let watchdog_perform_action() decide
what to do.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2124
Signed-off-by: Abhiram Tilak <atp.exp@gmail.com>
Message-id: 20240216192612.30838-4-atp.exp@gmail.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/rtc')
-rw-r--r--hw/rtc/m48t59.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/rtc/m48t59.c b/hw/rtc/m48t59.c
index aa44c4b20c..1585a2d399 100644
--- a/hw/rtc/m48t59.c
+++ b/hw/rtc/m48t59.c
@@ -36,6 +36,7 @@
 #include "qemu/bcd.h"
 #include "qemu/module.h"
 #include "trace.h"
+#include "sysemu/watchdog.h"
 
 #include "m48t59-internal.h"
 #include "migration/vmstate.h"
@@ -163,8 +164,7 @@ static void watchdog_cb (void *opaque)
     if (NVRAM->buffer[0x1FF7] & 0x80) {
         NVRAM->buffer[0x1FF7] = 0x00;
         NVRAM->buffer[0x1FFC] &= ~0x40;
-        /* May it be a hw CPU Reset instead ? */
-        qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET);
+        watchdog_perform_action();
     } else {
         qemu_set_irq(NVRAM->IRQ, 1);
         qemu_set_irq(NVRAM->IRQ, 0);