From patchwork Wed Jun 17 05:04:04 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 30791 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 n5H57hU4025135 for ; Wed, 17 Jun 2009 05:07:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932892AbZFQFHc (ORCPT ); Wed, 17 Jun 2009 01:07:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932894AbZFQFHc (ORCPT ); Wed, 17 Jun 2009 01:07:32 -0400 Received: from mail-pz0-f187.google.com ([209.85.222.187]:36157 "EHLO mail-pz0-f187.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932882AbZFQFHa (ORCPT ); Wed, 17 Jun 2009 01:07:30 -0400 Received: by pzk17 with SMTP id 17so131088pzk.33 for ; Tue, 16 Jun 2009 22:07:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=3v434lhDO67kVQlrDdfkvW2m6jrh8pwXr46+PuZLiUY=; b=gg550E/FS6I87ICpN46dMGi7u+ypa6eyg1eUI3mjYWyp2B0Z+8awlzG0IsxKbGIz92 9nI8f+6KY6qU+fHELKLNLiAEPtjWaOlxLGxadsLX4TBECx76XLI7baZhaBhB3DvDZ6z1 2aOT24nk2D+KV+059y6Wo1qZHKnoKLRyXI+/4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=eD5GIDlhr8Oz9dhlXM8CQZ6CO/PK1mjpCMHdIOeXjG9I1u7LeJ52w5piZz554yH4Ct KXw7a8yoDGJNp1cD6ISd8K5Ewqcjm87LLurAQoR3Pws+3bDNCwg3V+A45J7Yyw9mocvr gIXPyuPcIxHEAKv5zFj6BicIcK4kCJ0CDN6UI= Received: by 10.142.84.5 with SMTP id h5mr4789516wfb.200.1245215252689; Tue, 16 Jun 2009 22:07:32 -0700 (PDT) Received: from rx1.opensource.se (210.5.32.202.bf.2iij.net [202.32.5.210]) by mx.google.com with ESMTPS id 30sm244417wfg.30.2009.06.16.22.07.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 16 Jun 2009 22:07:32 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Wed, 17 Jun 2009 14:04:04 +0900 Message-Id: <20090617050404.15483.66515.sendpatchset@rx1.opensource.se> Subject: [PATCH] sh: turn off irqs when disabling CMT/TMU timers Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm Modify the CMT and TMU drivers to disable interrupts when disabling the timer. Only using start/stop bits is not enough. This fixes a bootup hang on Migo-R when the CMT is replaced by TMU for clockevents but the CMT keeps on delivering irqs even though the timer start bit is off. Signed-off-by: Magnus Damm --- drivers/clocksource/sh_cmt.c | 3 +++ drivers/clocksource/sh_tmu.c | 3 +++ 2 files changed, 6 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0001/drivers/clocksource/sh_cmt.c +++ work/drivers/clocksource/sh_cmt.c 2009-06-17 13:13:24.000000000 +0900 @@ -184,6 +184,9 @@ static void sh_cmt_disable(struct sh_cmt /* disable channel */ sh_cmt_start_stop_ch(p, 0); + /* disable interrupts in CMT block */ + sh_cmt_write(p, CMCSR, 0); + /* stop clock */ clk_disable(p->clk); } --- 0001/drivers/clocksource/sh_tmu.c +++ work/drivers/clocksource/sh_tmu.c 2009-06-17 13:13:17.000000000 +0900 @@ -138,6 +138,9 @@ static void sh_tmu_disable(struct sh_tmu /* disable channel */ sh_tmu_start_stop_ch(p, 0); + /* disable interrupts in TMU block */ + sh_tmu_write(p, TCR, 0x0000); + /* stop clock */ clk_disable(p->clk); }