Patchwork hw/arm_mptimer: Reset the qemu_timer at reset

login
register
mail settings
Submitter Peter Maydell
Date April 12, 2012, 11:09 a.m.
Message ID <1334228970-25799-1-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/152021/
State New
Headers show

Comments

Peter Maydell - April 12, 2012, 11:09 a.m.
On reset of the mpcore timer/watchdog block we need to
delete the qemu_timer in case it was running.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm_mptimer.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/arm_mptimer.c b/hw/arm_mptimer.c
index df7fb4c..fe43cbb 100644
--- a/hw/arm_mptimer.c
+++ b/hw/arm_mptimer.c
@@ -228,6 +228,9 @@  static void timerblock_reset(timerblock *tb)
     tb->control = 0;
     tb->status = 0;
     tb->tick = 0;
+    if (tb->timer) {
+        qemu_del_timer(tb->timer);
+    }
 }
 
 static void arm_mptimer_reset(DeviceState *dev)