From patchwork Wed Aug 10 13:19:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Pedanekar X-Patchwork-Id: 1053722 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7ADKHco028179 for ; Wed, 10 Aug 2011 13:20:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751205Ab1HJNT4 (ORCPT ); Wed, 10 Aug 2011 09:19:56 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:50116 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750857Ab1HJNT4 (ORCPT ); Wed, 10 Aug 2011 09:19:56 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id p7ADJgMc000956 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 10 Aug 2011 08:19:44 -0500 Received: from dbde70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id p7ADJfXt020337; Wed, 10 Aug 2011 18:49:41 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 8.3.106.1; Wed, 10 Aug 2011 18:49:41 +0530 Received: from psplinux052.india.ti.com (psplinux052.india.ti.com [172.24.162.245]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p7ADJbeW027845; Wed, 10 Aug 2011 18:49:38 +0530 (IST) Received: from psplinux052.india.ti.com (localhost [127.0.0.1]) by psplinux052.india.ti.com (8.13.1/8.13.1) with ESMTP id p7ADJbXu011911; Wed, 10 Aug 2011 18:49:37 +0530 Received: (from a0393588@localhost) by psplinux052.india.ti.com (8.13.1/8.13.1/Submit) id p7ADJa0B011902; Wed, 10 Aug 2011 18:49:36 +0530 From: Hemant Pedanekar To: CC: Tony Lindgren , Russell King , , , Hemant Pedanekar Subject: [PATCH v2] omap: timer: Set dmtimer used as clocksource in autoreload mode Date: Wed, 10 Aug 2011 18:49:35 +0530 Message-ID: <1312982375-11848-1-git-send-email-hemantp@ti.com> X-Mailer: git-send-email 1.7.3.5 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 10 Aug 2011 13:20:17 +0000 (UTC) If CONFIG_OMAP_32K_TIMER is not selected and dmtimer is used as clocksource, the timer stops counting once overflow occurs as it was not set in autoreload mode. This results into timekeeping failure: for example, 'sleep 1' at the shell after the timer counter overflow would hang. This patch sets up autoreload when starting the clocksource timer which fixes the above issue. Signed-off-by: Hemant Pedanekar --- arch/arm/mach-omap2/timer.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index e964072..cf1de7d 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c @@ -293,7 +293,8 @@ static void __init omap2_gp_clocksource_init(int gptimer_id, pr_info("OMAP clocksource: GPTIMER%d at %lu Hz\n", gptimer_id, clksrc.rate); - __omap_dm_timer_load_start(clksrc.io_base, OMAP_TIMER_CTRL_ST, 0, 1); + __omap_dm_timer_load_start(clksrc.io_base, + OMAP_TIMER_CTRL_ST | OMAP_TIMER_CTRL_AR, 0, 1); init_sched_clock(&cd, dmtimer_update_sched_clock, 32, clksrc.rate); if (clocksource_register_hz(&clocksource_gpt, clksrc.rate))