qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] arm_mptimer: Fix timer shutdown
@ 2015-07-01 21:15 Dmitry Osipenko
  2015-07-02  9:27 ` Peter Maydell
  0 siblings, 1 reply; 11+ messages in thread
From: Dmitry Osipenko @ 2015-07-01 21:15 UTC (permalink / raw)
  To: Paolo Bonzini, Peter Maydell; +Cc: Dmitry Osipenko, qemu-devel

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 <digetx@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-07-03 11:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-01 21:15 [Qemu-devel] [PATCH] arm_mptimer: Fix timer shutdown Dmitry Osipenko
2015-07-02  9:27 ` Peter Maydell
2015-07-02 12:10   ` Dmitry Osipenko
2015-07-02 17:20     ` [Qemu-devel] [PATCH v2] " Dmitry Osipenko
2015-07-02 17:34       ` Peter Maydell
2015-07-02 17:43         ` Dmitry Osipenko
2015-07-02 17:52         ` Dmitry Osipenko
2015-07-02 18:09           ` Peter Maydell
2015-07-02 18:43             ` Dmitry Osipenko
2015-07-02 18:50               ` Dmitry Osipenko
2015-07-03 11:41               ` Dmitry Osipenko

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).