From patchwork Tue Oct 23 15:22:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 193507 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3A6D62C00F3 for ; Wed, 24 Oct 2012 02:25:16 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TQgJd-0000dN-OP; Tue, 23 Oct 2012 15:22:49 +0000 Received: from mail-da0-f49.google.com ([209.85.210.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TQgJI-0000as-Is for linux-arm-kernel@lists.infradead.org; Tue, 23 Oct 2012 15:22:29 +0000 Received: by mail-da0-f49.google.com with SMTP id q27so1839904daj.36 for ; Tue, 23 Oct 2012 08:22:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=Qs86a1C7fPdyGE6OWVcJo98LMrTCtXzXMyvAS9xz6ak=; b=KxvEP2r/YAOD1LLma3TVf8OhCKPeMQnRU6y/pjlNFATpECm3vPbi5FGXwVJ5H2yzcH 4OiNWIJXHh01TGs0Yb0ZLdtbUxpcdKMBJWeEciEOVGIkJ2GHW+4dKPEydsoxuc6AKGJ+ L2OK4EUmTRAhTnO2zaftV8GMdqI8AAJyh10MENHeZeb4rp/h3xoIsE0TLGuLJ213iLh9 1s5RiE7Wa3/FPY37rJozC0sMSJVjZ2p+zrFJzDV276B97Vegzhgok/pv7hRuJsVSKbDu AyB0Ket/zhaGwuiMVeoAM6faBxHpTFT83KF9FPAjdc6aoxfa8WaEcSErntnyiLH4yY3I tfyQ== Received: by 10.68.200.227 with SMTP id jv3mr40768487pbc.162.1351005747106; Tue, 23 Oct 2012 08:22:27 -0700 (PDT) Received: from S2101-09.ap.freescale.net ([58.209.136.71]) by mx.google.com with ESMTPS id pj10sm7842864pbb.46.2012.10.23.08.22.23 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 23 Oct 2012 08:22:26 -0700 (PDT) From: Shawn Guo To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 02/10] ARM: imx: allow timer counter to roll over Date: Tue, 23 Oct 2012 23:22:51 +0800 Message-Id: <1351005779-30347-3-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1351005779-30347-1-git-send-email-shawn.guo@linaro.org> References: <1351005779-30347-1-git-send-email-shawn.guo@linaro.org> X-Gm-Message-State: ALoCoQl4gT463gllM4OFAzLgLbNXcYz3tIYGGLQILM4/n7yodFXZffKT0b5UaDV3s1l/xFDU1ClQ X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.210.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Sascha Hauer , Shawn Guo , Robert Lee X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org The timer is configured in free-run mode. The counter should be allowed to roll over to 0 when reaching 0xffffffff. Let's do that by always returning 0 in set_next_event. Signed-off-by: Shawn Guo --- arch/arm/mach-imx/time.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c index f017302..858098c 100644 --- a/arch/arm/mach-imx/time.c +++ b/arch/arm/mach-imx/time.c @@ -139,8 +139,7 @@ static int mx1_2_set_next_event(unsigned long evt, __raw_writel(tcmp, timer_base + MX1_2_TCMP); - return (int)(tcmp - __raw_readl(timer_base + MX1_2_TCN)) < 0 ? - -ETIME : 0; + return 0; } static int v2_set_next_event(unsigned long evt, @@ -152,8 +151,7 @@ static int v2_set_next_event(unsigned long evt, __raw_writel(tcmp, timer_base + V2_TCMP); - return (int)(tcmp - __raw_readl(timer_base + V2_TCN)) < 0 ? - -ETIME : 0; + return 0; } #ifdef DEBUG