qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Abhiram Tilak <atp.exp@gmail.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, clg@kaod.org,
	david@gibson.dropbear.id.au, harshpb@linux.ibm.com,
	Abhiram Tilak <atp.exp@gmail.com>
Subject: [PATCH v2 2/2] misc: pxa2xx_timer: replace qemu_system_reset_request() call with watchdog_perform_action()
Date: Sat, 17 Feb 2024 00:56:14 +0530	[thread overview]
Message-ID: <20240216192612.30838-5-atp.exp@gmail.com> (raw)
In-Reply-To: <20240216192612.30838-2-atp.exp@gmail.com>

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>
---
 hw/timer/pxa2xx_timer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/timer/pxa2xx_timer.c b/hw/timer/pxa2xx_timer.c
index 6a7d5551f4..6479ab1a8b 100644
--- a/hw/timer/pxa2xx_timer.c
+++ b/hw/timer/pxa2xx_timer.c
@@ -18,6 +18,7 @@
 #include "qemu/log.h"
 #include "qemu/module.h"
 #include "qom/object.h"
+#include "sysemu/watchdog.h"
 
 #define OSMR0	0x00
 #define OSMR1	0x04
@@ -417,7 +418,7 @@ static void pxa2xx_timer_tick(void *opaque)
     if (t->num == 3)
         if (i->reset3 & 1) {
             i->reset3 = 0;
-            qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET);
+            watchdog_perform_action();
         }
 }
 
-- 
2.42.1



  parent reply	other threads:[~2024-02-16 19:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 19:26 [PATCH v2 0/2] Misc: Make watchdog devices using qemu_system_reset_request() use watchdog_perfom_action() Abhiram Tilak
2024-02-16 19:26 ` [PATCH v2 1/2] misc: m48t59: replace qemu_system_reset_request() call with watchdog_perform_action() Abhiram Tilak
2024-02-16 19:26 ` Abhiram Tilak [this message]
2024-02-22 14:01 ` [PATCH v2 0/2] Misc: Make watchdog devices using qemu_system_reset_request() use watchdog_perfom_action() Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240216192612.30838-5-atp.exp@gmail.com \
    --to=atp.exp@gmail.com \
    --cc=clg@kaod.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=harshpb@linux.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).