From patchwork Sun May 2 09:50:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rabin Vincent X-Patchwork-Id: 51461 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 60398B6EEB for ; Sun, 2 May 2010 19:51:07 +1000 (EST) Received: from localhost ([127.0.0.1]:43582 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O8VpI-0003FH-Gx for incoming@patchwork.ozlabs.org; Sun, 02 May 2010 05:51:04 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O8VoJ-0003Ez-RI for qemu-devel@nongnu.org; Sun, 02 May 2010 05:50:03 -0400 Received: from [140.186.70.92] (port=36363 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O8VoH-0003Ef-Mp for qemu-devel@nongnu.org; Sun, 02 May 2010 05:50:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O8VoG-0007qY-Dv for qemu-devel@nongnu.org; Sun, 02 May 2010 05:50:01 -0400 Received: from mail-pz0-f204.google.com ([209.85.222.204]:50809) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O8VoG-0007qO-1P for qemu-devel@nongnu.org; Sun, 02 May 2010 05:50:00 -0400 Received: by pzk42 with SMTP id 42so808195pzk.4 for ; Sun, 02 May 2010 02:49:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:cc:subject :date:message-id:x-mailer:in-reply-to:references; bh=MS0FzVlY4lBsRMcyC3z3wtWtSCfz1hV3h4MX4oy4qoo=; b=CA3efJ1eS7FHTt4rID1qC2oUNQTyXWqrWao6MDuxdAsEGYRiq/pJoLxjI/3obUJiLn x4Eunmygj4wW/jgEhlQYwmln0EkkD6jLPU7IjWansEP/c3o0vss9rs7rPYvUR9W74Cxy 8+DDcjo/7DXZdumlkFH1F9HzcefeKkadPZPIc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; b=b5qKlR19HCOStyKpESkBZHuKTeRr3JX2LXB1hLJmZOb145/r2oxVI3pUQhaBQbaN22 LVphQrOpUQPBCoL9iCdu+bhVOIMeELpo2voWK+Q7+wMbnMnL3pUOg+cm1Pze8fqeTqnZ 3PvempnrH2WrtfAUlsAJTb073FuL60iP344qY= Received: by 10.114.18.4 with SMTP id 4mr14038457war.186.1272793798838; Sun, 02 May 2010 02:49:58 -0700 (PDT) Received: from localhost.localdomain ([59.164.103.211]) by mx.google.com with ESMTPS id d20sm18519876waa.3.2010.05.02.02.49.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 02 May 2010 02:49:58 -0700 (PDT) From: Rabin Vincent To: qemu-devel@nongnu.org Date: Sun, 2 May 2010 15:20:52 +0530 Message-Id: <1272793852-26260-2-git-send-email-rabin@rab.in> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1272793852-26260-1-git-send-email-rabin@rab.in> References: <1272793852-26260-1-git-send-email-rabin@rab.in> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: Rabin Vincent Subject: [Qemu-devel] [PATCH 2/2] arm_timer: fix oneshot mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org In oneshot mode, the delta needs to come from the TimerLoad register, not the maximum limit. Signed-off-by: Rabin Vincent --- hw/arm_timer.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/arm_timer.c b/hw/arm_timer.c index 5b6947a..9073ffc 100644 --- a/hw/arm_timer.c +++ b/hw/arm_timer.c @@ -71,7 +71,7 @@ static void arm_timer_recalibrate(arm_timer_state *s, int reload) { uint32_t limit; - if ((s->control & TIMER_CTRL_PERIODIC) == 0) { + if ((s->control & (TIMER_CTRL_PERIODIC | TIMER_CTRL_ONESHOT)) == 0) { /* Free running. */ if (s->control & TIMER_CTRL_32BIT) limit = 0xffffffff;