From patchwork Fri Oct 23 16:03:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 55572 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9NGIddP017213 for ; Fri, 23 Oct 2009 16:18:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752506AbZJWQSc (ORCPT ); Fri, 23 Oct 2009 12:18:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752488AbZJWQSc (ORCPT ); Fri, 23 Oct 2009 12:18:32 -0400 Received: from smtp.nokia.com ([192.100.105.134]:19346 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752485AbZJWQSb (ORCPT ); Fri, 23 Oct 2009 12:18:31 -0400 Received: from esebh106.NOE.Nokia.com (esebh106.ntc.nokia.com [172.21.138.213]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n9NGIQ7u027784 for ; Fri, 23 Oct 2009 11:18:35 -0500 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 23 Oct 2009 19:18:34 +0300 Received: from mgw-da02.ext.nokia.com ([147.243.128.26]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Fri, 23 Oct 2009 19:18:31 +0300 Received: from localhost.localdomain (sokoban.ntc.nokia.com [172.22.144.95]) by mgw-da02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n9NGIPi7022176 for ; Fri, 23 Oct 2009 19:18:29 +0300 From: Tero Kristo To: linux-omap@vger.kernel.org Subject: [PATCH 03/11] OMAP2/3: DMTIMER: Clear pending interrupts when stopping a timer Date: Fri, 23 Oct 2009 19:03:47 +0300 Message-Id: <1256313835-2391-4-git-send-email-tero.kristo@nokia.com> X-Mailer: git-send-email 1.5.4.3 In-Reply-To: <1256313835-2391-3-git-send-email-tero.kristo@nokia.com> References: <> <1256313835-2391-1-git-send-email-tero.kristo@nokia.com> <1256313835-2391-2-git-send-email-tero.kristo@nokia.com> <1256313835-2391-3-git-send-email-tero.kristo@nokia.com> X-OriginalArrivalTime: 23 Oct 2009 16:18:31.0636 (UTC) FILETIME=[76603140:01CA53FC] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c index 830b072..09a623d 100644 --- a/arch/arm/plat-omap/dmtimer.c +++ b/arch/arm/plat-omap/dmtimer.c @@ -551,6 +551,16 @@ void omap_dm_timer_stop(struct omap_dm_timer *timer) if (l & OMAP_TIMER_CTRL_ST) { l &= ~0x1; omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l); + /* Readback to make sure write has completed */ + omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG); + /* + * Wait for functional clock period x 3.5 to make sure that + * timer is stopped + */ + udelay(3500000 / clk_get_rate(timer->fclk) + 1); + /* Ack possibly pending interrupt */ + omap_dm_timer_write_reg(timer, OMAP_TIMER_STAT_REG, + OMAP_TIMER_INT_OVERFLOW); } } EXPORT_SYMBOL_GPL(omap_dm_timer_stop);