qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH] arm_mptimer: Fix timer shutdown


From: Dmitry Osipenko
Subject: [Qemu-devel] [PATCH] arm_mptimer: Fix timer shutdown
Date: Thu, 2 Jul 2015 00:15:19 +0300

Timer, running in periodic mode, can't be stopped or coming one-shot tick
won't be canceled because timer control code just doesn't handle timer
disabling. Fix it by checking enable bit and deleting timer if bit isn't set.

Signed-off-by: Dmitry Osipenko <address@hidden>
---
 hw/timer/arm_mptimer.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/timer/arm_mptimer.c b/hw/timer/arm_mptimer.c
index 8b93b3c..917a10f 100644
--- a/hw/timer/arm_mptimer.c
+++ b/hw/timer/arm_mptimer.c
@@ -127,6 +127,9 @@ static void timerblock_write(void *opaque, hwaddr addr,
                 tb->count = tb->load;
             }
             timerblock_reload(tb, 1);
+        } else if (!(value & 1)) {
+            /* Shutdown timer.  */
+            timer_del(tb->timer);
         }
         break;
     case 12: /* Interrupt status.  */
-- 
2.4.4




reply via email to

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