* [PATCH v2 0/2] Misc: Make watchdog devices using qemu_system_reset_request() use watchdog_perfom_action()
@ 2024-02-16 19:26 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
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Abhiram Tilak @ 2024-02-16 19:26 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, clg, david, harshpb, Abhiram Tilak
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.
v2:
- Remove redundant comment in patch1 in m48t59.
- Exclude patch 3 from patch series due to current call being more preferable.
Abhiram Tilak (2):
misc: m48t59: replace qemu_system_reset_request() call with
watchdog_perform_action()
misc: pxa2xx_timer: replace qemu_system_reset_request() call with
watchdog_perform_action()
hw/rtc/m48t59.c | 4 ++--
hw/timer/pxa2xx_timer.c | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
--
2.42.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 1/2] misc: m48t59: replace qemu_system_reset_request() call with watchdog_perform_action()
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 ` Abhiram Tilak
2024-02-16 19:26 ` [PATCH v2 2/2] misc: pxa2xx_timer: " Abhiram Tilak
2024-02-22 14:01 ` [PATCH v2 0/2] Misc: Make watchdog devices using qemu_system_reset_request() use watchdog_perfom_action() Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Abhiram Tilak @ 2024-02-16 19:26 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, clg, david, harshpb, Abhiram Tilak
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/rtc/m48t59.c | 4 ++--
1 file 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);
--
2.42.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 2/2] misc: pxa2xx_timer: replace qemu_system_reset_request() call with watchdog_perform_action()
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
2024-02-22 14:01 ` [PATCH v2 0/2] Misc: Make watchdog devices using qemu_system_reset_request() use watchdog_perfom_action() Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Abhiram Tilak @ 2024-02-16 19:26 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, clg, david, harshpb, Abhiram Tilak
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 0/2] Misc: Make watchdog devices using qemu_system_reset_request() use watchdog_perfom_action()
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 ` [PATCH v2 2/2] misc: pxa2xx_timer: " Abhiram Tilak
@ 2024-02-22 14:01 ` Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2024-02-22 14:01 UTC (permalink / raw)
To: Abhiram Tilak; +Cc: qemu-devel, clg, david, harshpb
On Fri, 16 Feb 2024 at 19:27, Abhiram Tilak <atp.exp@gmail.com> wrote:
>
> 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.
>
> v2:
> - Remove redundant comment in patch1 in m48t59.
> - Exclude patch 3 from patch series due to current call being more preferable.
Thanks for sending this contribution; I've applied it to target-arm.next
and it should get into git either this week or early next week.
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-02-22 14:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH v2 2/2] misc: pxa2xx_timer: " Abhiram Tilak
2024-02-22 14:01 ` [PATCH v2 0/2] Misc: Make watchdog devices using qemu_system_reset_request() use watchdog_perfom_action() Peter Maydell
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).