From patchwork Thu Jul 21 14:31:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 9241787 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A319B602F0 for ; Thu, 21 Jul 2016 14:34:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 953FD1FF10 for ; Thu, 21 Jul 2016 14:34:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8791E1FF60; Thu, 21 Jul 2016 14:34:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6880A1FF10 for ; Thu, 21 Jul 2016 14:34:31 +0000 (UTC) Received: from localhost ([::1]:41178 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQF3W-0004Ea-ES for patchwork-qemu-devel@patchwork.kernel.org; Thu, 21 Jul 2016 10:34:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQF1Y-00030y-Gv for qemu-devel@nongnu.org; Thu, 21 Jul 2016 10:32:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQF1U-0003iv-Du for qemu-devel@nongnu.org; Thu, 21 Jul 2016 10:32:28 -0400 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]:35643) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQF1U-0003ic-71; Thu, 21 Jul 2016 10:32:24 -0400 Received: by mail-lf0-x241.google.com with SMTP id l89so5648055lfi.2; Thu, 21 Jul 2016 07:32:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=kQ8Ku6bL5itKmaunWgJl3AM88BULUpzaxUC8l+OvF1o=; b=igHN1t5de/m0mRYyAyO6DKUeT/1Wxzbl2nFfcgF8mb7oFgnMXqttyR8p9FxaoNHVm+ HkqteHTV7hvWLZrHQ9BiSJL1IUo6MAd/fi8lWtbyYnwReIovAs4lcmm+HjwkaeB2JYYm FbnRr2cQ2uDOY+GAlyVqC8j+a9ynC/OcOP0k81AoF8MC8E2lomZZ7TqoQRtJXgSnDBrX A/VwdFBX3/dhnZlPjXluuWYeMyWYB2jWwfW859hFBPtwjpRFKdWhTRAMaClsSzOeqQQg jfEa1TFsAqieG+BudhR/0Eqf+ypxvGEK/RfBkVESZkRh3eiw+eYpdifqFj0hlfKTVw07 ZR6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=kQ8Ku6bL5itKmaunWgJl3AM88BULUpzaxUC8l+OvF1o=; b=W9WzRf2hXu6uI7KSO3vv8TZzSH4OclqNSCMU4OFblkihuNST6Yfzl86mEp9wHui6Yj SddT1mdx1VLL98OgIvNCw+9a3tuLQ+LlAOWnEKoQS2myO/0NZ3SEaCGcJlYIQG7QQu7k myqNpLEreF6uWvdZuL8DzCrH2goQtRXszhsm1ah0+9PXlvnl3G88+fW0oPkzpkyfE5bK j2M4npWR/MBExsl4x7jQaARSSjdDKkE6/6XwS6GlRuP0NHNAU/uKNjj/iQP+0w/3HWVX 5kZftxcl2Nu9PqRZ2EKNZUhS5D9VtkqHtNBWtBIab85RWsudLNk3EcJQB5XnHE7ejjsO /BrA== X-Gm-Message-State: ALyK8tJmpzKTRUBrETjyYFM+Gwy3G6C657LgKFE9vmcYZrSRzD1esSGm3HSe8Uex8RxFmg== X-Received: by 10.25.79.132 with SMTP id d126mr15820447lfb.68.1469111543441; Thu, 21 Jul 2016 07:32:23 -0700 (PDT) Received: from localhost.localdomain (ppp109-252-52-30.pppoe.spdop.ru. [109.252.52.30]) by smtp.gmail.com with ESMTPSA id c12sm1887932lfc.40.2016.07.21.07.32.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Jul 2016 07:32:22 -0700 (PDT) From: Dmitry Osipenko To: QEMU Developers , qemu-arm@nongnu.org Date: Thu, 21 Jul 2016 17:31:14 +0300 Message-Id: X-Mailer: git-send-email 2.9.2 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::241 Subject: [Qemu-devel] [PATCH v15 03/15] hw/ptimer: Actually stop timer in case of error X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Peter Crosthwaite Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- hw/core/ptimer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/core/ptimer.c b/hw/core/ptimer.c index 461b91c..1dd2d32 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; }