mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chanho Min <chanho.min@lge.com>
To: Russell King <linux@arm.linux.org.uk>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Michael Opdenacker <michael@free-electrons.com>,
	Linus Walleij <linus.walleij@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Jongsung Kim <neidhard.kim@lge.com>,
	Chanho Min <chanho.min@lge.com>
Subject: [PATCH v2] ARM: timer-sp: ensure interrupt is cleared at sp804_of_init
Date: Wed, 17 Sep 2014 20:34:46 +0900	[thread overview]
Message-ID: <1410953686-15072-1-git-send-email-chanho.min@lge.com> (raw)

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 <chanho.min@lge.com>
---
 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;
 
-- 
1.7.9.5


             reply	other threads:[~2014-09-17 11:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-17 11:34 Chanho Min [this message]
2014-09-17 11:57 ` Russell King - ARM Linux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1410953686-15072-1-git-send-email-chanho.min@lge.com \
    --to=chanho.min@lge.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=michael@free-electrons.com \
    --cc=neidhard.kim@lge.com \
    --cc=sboyd@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®