From patchwork Wed Sep 17 11:34:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Min X-Patchwork-Id: 4923781 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 763CFBEEA5 for ; Wed, 17 Sep 2014 11:38:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5FFE120179 for ; Wed, 17 Sep 2014 11:38:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8044120166 for ; Wed, 17 Sep 2014 11:38:19 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XUDWI-0002si-3R; Wed, 17 Sep 2014 11:35:34 +0000 Received: from lgemrelse6q.lge.com ([156.147.1.121]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XUDWF-0002oa-60 for linux-arm-kernel@lists.infradead.org; Wed, 17 Sep 2014 11:35:32 +0000 Received: from unknown (HELO ls-2.156.147.135.180) (10.186.119.199) by 156.147.1.121 with ESMTP; 17 Sep 2014 20:35:04 +0900 X-Original-SENDERIP: 10.186.119.199 X-Original-MAILFROM: chanho.min@lge.com From: Chanho Min To: Russell King , Stephen Boyd , Michael Opdenacker , Linus Walleij Subject: [PATCH v2] ARM: timer-sp: ensure interrupt is cleared at sp804_of_init Date: Wed, 17 Sep 2014 20:34:46 +0900 Message-Id: <1410953686-15072-1-git-send-email-chanho.min@lge.com> X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140917_043531_544790_02B5351F X-CRM114-Status: UNSURE ( 8.64 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.4 (-) Cc: Jongsung Kim , Chanho Min , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP sp804 may not be added to the tick device if the higher device is already registered. In this case, If pending interrupt is existed (usually It will be passed from the boot loader), inetrrupt is occured without event_handler then it cause kernel panic. So Interrupts should be cleared before clockevent is registered. Changes since v1: - Move to sp804_of_init - Clear TIMER2 interrupt - Update commit log Signed-off-by: Chanho Min --- arch/arm/common/timer-sp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/common/timer-sp.c b/arch/arm/common/timer-sp.c index fd6bff0..e3cc08e 100644 --- a/arch/arm/common/timer-sp.c +++ b/arch/arm/common/timer-sp.c @@ -226,6 +226,10 @@ static void __init sp804_of_init(struct device_node *np) writel(0, base + TIMER_CTRL); writel(0, base + TIMER_2_BASE + TIMER_CTRL); + /* Ensure interrupt is cleared */ + writel(1, base + TIMER_INTCLR); + writel(1, base + TIMER_2_BASE + TIMER_INTCLR); + if (initialized || !of_device_is_available(np)) goto err;