From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn7hb-0005iE-UL for qemu-devel@nongnu.org; Thu, 22 Sep 2016 13:22:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn7hZ-0002fO-Vm for qemu-devel@nongnu.org; Thu, 22 Sep 2016 13:22:26 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:47095) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn7hZ-0002eX-Jf for qemu-devel@nongnu.org; Thu, 22 Sep 2016 13:22:25 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1bn7hZ-0007Gr-1t for qemu-devel@nongnu.org; Thu, 22 Sep 2016 18:22:25 +0100 From: Peter Maydell Date: Thu, 22 Sep 2016 18:21:55 +0100 Message-Id: <1474564935-23831-17-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1474564935-23831-1-git-send-email-peter.maydell@linaro.org> References: <1474564935-23831-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PULL 16/36] hw/ptimer: Actually stop the timer in case of error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From: Dmitry Osipenko 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 Message-id: 1e9bae4fae3c36430d7c28b0f486a0c71aff7eb3.1473252818.git.digetx@gmail.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- 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.7.4