From: "Heiko Stübner" <heiko@sntech.de>
To: John Stultz <john.stultz@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Jamie Iles <jamie@jamieiles.com>,
Dinh Nguyen <dinguyen@altera.com>,
Grant Likely <grant.likely@linaro.org>,
linux-arm-kernel@lists.infradead.org,
Rob Herring <rob.herring@calxeda.com>,
devicetree-discuss@lists.ozlabs.org,
linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
Olof Johansson <olof@lixom.net>,
Ulrich Prinz <ulrich.prinz@googlemail.com>
Subject: [PATCH 4/9] clocksource: dw_apb_timer: use the eoi callback to clear pending interrupts
Date: Sat, 6 Jul 2013 00:53:36 +0200 [thread overview]
Message-ID: <201307060053.36885.heiko@sntech.de> (raw)
In-Reply-To: <201307060051.09716.heiko@sntech.de>
Some timer variants have different mechanisms to clear a pending timer
interrupt. Therefore don't hardcode the reading of the eoi register to
clear them, but instead use the already existing eoi callback for this.
Signed-off-by: Ulrich Prinz <ulrich.prinz@googlemail.com>
---
drivers/clocksource/dw_apb_timer.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/clocksource/dw_apb_timer.c b/drivers/clocksource/dw_apb_timer.c
index bd45351..5f80a30 100644
--- a/drivers/clocksource/dw_apb_timer.c
+++ b/drivers/clocksource/dw_apb_timer.c
@@ -121,11 +121,14 @@ static irqreturn_t dw_apb_clockevent_irq(int irq, void *data)
return IRQ_HANDLED;
}
-static void apbt_enable_int(struct dw_apb_timer *timer)
+static void apbt_enable_int(struct dw_apb_clock_event_device *dw_ced)
{
+ struct dw_apb_timer *timer = &dw_ced->timer;
unsigned long ctrl = apbt_readl(timer, timer->reg_control);
+
/* clear pending intr */
- apbt_readl(timer, timer->reg_eoi);
+ if (dw_ced->eoi)
+ dw_ced->eoi(timer);
ctrl &= ~APBTMR_CONTROL_INT;
apbt_writel(timer, ctrl, timer->reg_control);
}
@@ -200,7 +203,7 @@ static void apbt_set_mode(enum clock_event_mode mode,
break;
case CLOCK_EVT_MODE_RESUME:
- apbt_enable_int(timer);
+ apbt_enable_int(dw_ced);
break;
}
}
@@ -325,7 +328,7 @@ void dw_apb_clockevent_register(struct dw_apb_clock_event_device *dw_ced)
apbt_writel(timer, 0, timer->reg_control);
clockevents_register_device(&dw_ced->ced);
- apbt_enable_int(timer);
+ apbt_enable_int(dw_ced);
}
/**
--
1.7.10.4
next prev parent reply other threads:[~2013-07-05 22:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-05 22:51 [PATCH 0/9] clocksource: dw_apb_timer: support for timer variant used in rk3188 SoCs Heiko Stübner
2013-07-05 22:51 ` [PATCH 1/9] clocksource: dw_apb_timer: infrastructure to handle quirks Heiko Stübner
2013-07-05 22:52 ` [PATCH 2/9] clocksource: dw_apb_timer: flexible register addresses Heiko Stübner
2013-07-05 22:53 ` [PATCH 3/9] clocksource: dw_apb_timer: quirk for variants with 64bit counter Heiko Stübner
[not found] ` <201307060053.10182.heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
2013-07-05 23:45 ` Thomas Gleixner
2013-07-06 20:19 ` Ulrich Prinz
2013-07-05 22:53 ` Heiko Stübner [this message]
2013-07-05 22:59 ` [PATCH 4/9] clocksource: dw_apb_timer: use the eoi callback to clear pending interrupts Heiko Stübner
2013-07-05 22:54 ` [PATCH 5/9] clocksource: dw_apb_timer: quirk for variants without EOI register Heiko Stübner
[not found] ` <201307060054.07784.heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
2013-07-05 22:58 ` Heiko Stübner
2013-07-05 23:49 ` Thomas Gleixner
2013-07-05 22:54 ` [PATCH 6/9] clocksource: dw_apb_timer: quirk for inverted int mask Heiko Stübner
2013-07-05 22:58 ` Heiko Stübner
[not found] ` <201307060054.35996.heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
2013-07-05 23:51 ` Thomas Gleixner
[not found] ` <201307060051.09716.heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
2013-07-05 22:55 ` [PATCH 7/9] clocksource: dw_apb_timer: quirk for inverted timer mode setting Heiko Stübner
2013-07-05 22:56 ` [PATCH 8/9] clocksource: dw_apb_timer_of: add quirk handling Heiko Stübner
2013-07-05 22:56 ` [PATCH 9/9] clocksource: dw_apb_timer: special variant for rockchip rk3188 timers Heiko Stübner
[not found] ` <201307060056.29370.heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
2013-07-06 0:12 ` Thomas Gleixner
2013-07-06 20:28 ` Ulrich Prinz
[not found] ` <51D87E04.3060704-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2013-07-06 21:00 ` Thomas Gleixner
2013-07-11 22:44 ` Ulrich Prinz
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=201307060053.36885.heiko@sntech.de \
--to=heiko@sntech.de \
--cc=arnd@arndb.de \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=dinguyen@altera.com \
--cc=grant.likely@linaro.org \
--cc=jamie@jamieiles.com \
--cc=john.stultz@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=olof@lixom.net \
--cc=rob.herring@calxeda.com \
--cc=tglx@linutronix.de \
--cc=ulrich.prinz@googlemail.com \
/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;
as well as URLs for NNTP newsgroup(s).