From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBvDD-0000ks-3E for qemu-devel@nongnu.org; Sun, 05 Jul 2015 21:28:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZBvD8-0005Ul-1E for qemu-devel@nongnu.org; Sun, 05 Jul 2015 21:28:47 -0400 Received: from mail-la0-x22c.google.com ([2a00:1450:4010:c03::22c]:36445) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBvD7-0005Ub-Oz for qemu-devel@nongnu.org; Sun, 05 Jul 2015 21:28:41 -0400 Received: by lagc2 with SMTP id c2so136686136lag.3 for ; Sun, 05 Jul 2015 18:28:41 -0700 (PDT) From: Dmitry Osipenko Date: Mon, 6 Jul 2015 04:27:12 +0300 Message-Id: <1436146032-13112-1-git-send-email-digetx@gmail.com> In-Reply-To: <5599D3C0.8040807@gmail.com> References: <5599D3C0.8040807@gmail.com> Subject: [Qemu-devel] [PATCH v4] arm_mptimer: Respect IT bit state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite , Peter Maydell Cc: Paolo Bonzini , QEMU Developers The timer should fire the interrupt only if the IT (interrupt enable) bit state of the control register is enabled. Signed-off-by: Dmitry Osipenko Reviewed-by: Peter Crosthwaite --- v2: Added missed IRQ status update on control register write as per Peter Crosthwaite comment. v3: No code change, just re-send. v4: Revert to v1, as it was correct, with a slightly change commit message. hw/timer/arm_mptimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/timer/arm_mptimer.c b/hw/timer/arm_mptimer.c index 0e132b1..3e59c2a 100644 --- a/hw/timer/arm_mptimer.c +++ b/hw/timer/arm_mptimer.c @@ -38,7 +38,7 @@ static inline int get_current_cpu(ARMMPTimerState *s) static inline void timerblock_update_irq(TimerBlock *tb) { - qemu_set_irq(tb->irq, tb->status); + qemu_set_irq(tb->irq, tb->status && (tb->control & 4)); } /* Return conversion factor from mpcore timer ticks to qemu timer ticks. */ -- 2.4.4