qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-arm] [PATCH v16 01/16] hw/ptimer: Actually stop the timer in case


From: Dmitry Osipenko
Subject: [Qemu-arm] [PATCH v16 01/16] hw/ptimer: Actually stop the timer in case of error
Date: Wed, 7 Sep 2016 16:22:12 +0300

Running with counter / period = 0 is treated as a error case, printing error
message claiming that timer has been disabled. However, timer is only marked
as disabled, keeping to tick till expired and triggering after being claimed
as disabled. Stop the QEMU timer to avoid confusion.

Signed-off-by: Dmitry Osipenko <address@hidden>
---
 hw/core/ptimer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/core/ptimer.c b/hw/core/ptimer.c
index 30829ee..02c3135 100644
--- a/hw/core/ptimer.c
+++ b/hw/core/ptimer.c
@@ -44,6 +44,7 @@ static void ptimer_reload(ptimer_state *s)
     }
     if (s->delta == 0 || s->period == 0) {
         fprintf(stderr, "Timer with period zero, disabling\n");
+        timer_del(s->timer);
         s->enabled = 0;
         return;
     }
-- 
2.9.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]