From patchwork Wed Sep 17 00:42:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Min X-Patchwork-Id: 4922091 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 31E669F32F for ; Wed, 17 Sep 2014 00:44:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3528620142 for ; Wed, 17 Sep 2014 00:45:51 +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 459C720138 for ; Wed, 17 Sep 2014 00:45:50 +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 1XU3LF-00075N-92; Wed, 17 Sep 2014 00:43:29 +0000 Received: from lgeamrelo02.lge.com ([156.147.1.126]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XU3LD-000723-4i for linux-arm-kernel@lists.infradead.org; Wed, 17 Sep 2014 00:43:28 +0000 Received: from unknown (HELO mambo.154.147.1.1) (10.178.36.63) by 156.147.1.126 with ESMTP; 17 Sep 2014 09:42:46 +0900 X-Original-SENDERIP: 10.178.36.63 X-Original-MAILFROM: chanho.min@lge.com From: Chanho Min To: Russell King , Stephen Boyd , Michael Opdenacker , Linus Walleij Subject: [PATCH] ARM: timer-sp: ensure interrupt is cleared at sp804_clockevents_init Date: Wed, 17 Sep 2014 09:42:51 +0900 Message-Id: <1410914571-8388-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-20140916_174327_516256_BCCE45E4 X-CRM114-Status: UNSURE ( 7.65 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -3.0 (---) Cc: 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 When sp804 is registerd as clock event device, it may not be added to tick device if the higher rated device is already registerd. In this case, for uncertan reason, inetrrupt is occured without event_handler it cause kernel panic. So Interrupt should be cleared before clockevent is registered. Signed-off-by: Chanho Min --- arch/arm/common/timer-sp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/common/timer-sp.c b/arch/arm/common/timer-sp.c index fd6bff0..b658873 100644 --- a/arch/arm/common/timer-sp.c +++ b/arch/arm/common/timer-sp.c @@ -205,6 +205,8 @@ void __init __sp804_clockevents_init(void __iomem *base, unsigned int irq, struc writel(0, base + TIMER_CTRL); + /* Ensure interrupt is cleared */ + writel(1, clkevt_base + TIMER_INTCLR); setup_irq(irq, &sp804_timer_irq); clockevents_config_and_register(evt, rate, 0xf, 0xffffffff); }