From patchwork Fri Jan 8 17:59:19 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 71826 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o08HxZHa023664 for ; Fri, 8 Jan 2010 17:59:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753626Ab0AHR7g (ORCPT ); Fri, 8 Jan 2010 12:59:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753624Ab0AHR7g (ORCPT ); Fri, 8 Jan 2010 12:59:36 -0500 Received: from mail-px0-f174.google.com ([209.85.216.174]:51031 "EHLO mail-px0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753616Ab0AHR7g (ORCPT ); Fri, 8 Jan 2010 12:59:36 -0500 Received: by mail-px0-f174.google.com with SMTP id 4so2222956pxi.33 for ; Fri, 08 Jan 2010 09:59:35 -0800 (PST) Received: by 10.142.118.3 with SMTP id q3mr2038458wfc.9.1262973575808; Fri, 08 Jan 2010 09:59:35 -0800 (PST) Received: from localhost (deeprootsystems.com [216.254.16.51]) by mx.google.com with ESMTPS id 21sm18884554pzk.7.2010.01.08.09.59.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 08 Jan 2010 09:59:35 -0800 (PST) From: Kevin Hilman To: linux-omap@vger.kernel.org Cc: Tero Kristo Subject: [PATCH 01/13] OMAP2/3: DMTIMER: Clear pending interrupts when stopping a timer Date: Fri, 8 Jan 2010 09:59:19 -0800 Message-Id: <1262973571-25796-2-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.6.6.rc2.1.g42108 In-Reply-To: <1262973571-25796-1-git-send-email-khilman@deeprootsystems.com> References: <1262973571-25796-1-git-send-email-khilman@deeprootsystems.com> 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 64f407e..5502ce8 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);