* [PATCH 2/4] ARM: smp_twd: create a percpu reference to the clockevent
@ 2011-12-12 9:57 Linus Walleij
2011-12-12 13:49 ` Russell King - ARM Linux
0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2011-12-12 9:57 UTC (permalink / raw)
To: linux-arm-kernel
From: Linus Walleij <linus.walleij@linaro.org>
This break-out from Colin Cross' cpufreq-aware TWD patch will
create a local percpu reference to the clock event, so we can
reference the event when the frequency of the TWD clock input
changes at runtime.
Signed-off-by: Colin Cross <ccross@android.com>
Cc: Russell King <linux@arm.linux.org.uk>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
[Broke out of larger SMP TWD patch]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
arch/arm/kernel/smp_twd.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index f057561..20cce4e 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -17,6 +17,7 @@
#include <linux/clockchips.h>
#include <linux/irq.h>
#include <linux/io.h>
+#include <linux/percpu.h>
#include <asm/smp_twd.h>
#include <asm/localtimer.h>
@@ -26,6 +27,7 @@
void __iomem *twd_base;
static unsigned long twd_timer_rate;
+static DEFINE_PER_CPU(struct clock_event_device *, twd_ce);
static struct clock_event_device __percpu **twd_evt;
@@ -177,6 +179,8 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk)
this_cpu_clk = __this_cpu_ptr(twd_evt);
*this_cpu_clk = clk;
+ __get_cpu_var(twd_ce) = clk;
+
clockevents_config_and_register(clk, twd_timer_rate,
0xf, 0xffffffff);
enable_percpu_irq(clk->irq, 0);
--
1.7.3.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/4] ARM: smp_twd: create a percpu reference to the clockevent
2011-12-12 9:57 [PATCH 2/4] ARM: smp_twd: create a percpu reference to the clockevent Linus Walleij
@ 2011-12-12 13:49 ` Russell King - ARM Linux
2011-12-13 11:31 ` Linus Walleij
0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2011-12-12 13:49 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 10:57:10AM +0100, Linus Walleij wrote:
> static unsigned long twd_timer_rate;
> +static DEFINE_PER_CPU(struct clock_event_device *, twd_ce);
>
> static struct clock_event_device __percpu **twd_evt;
So, one pointer to the clock_event_device is not enough? Could we have
one or the other?
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/4] ARM: smp_twd: create a percpu reference to the clockevent
2011-12-12 13:49 ` Russell King - ARM Linux
@ 2011-12-13 11:31 ` Linus Walleij
0 siblings, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2011-12-13 11:31 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2011 at 2:49 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Mon, Dec 12, 2011 at 10:57:10AM +0100, Linus Walleij wrote:
>> ?static unsigned long twd_timer_rate;
>> +static DEFINE_PER_CPU(struct clock_event_device *, twd_ce);
>>
>> ?static struct clock_event_device __percpu **twd_evt;
>
> So, one pointer to the clock_event_device is not enough? ?Could we have
> one or the other?
Bah, just me being lame and not seeing that Marc already made
these events per-cpu.
I'll update the CPUfreq patch and drop this crap.
Thanks,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-12-13 11:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-12 9:57 [PATCH 2/4] ARM: smp_twd: create a percpu reference to the clockevent Linus Walleij
2011-12-12 13:49 ` Russell King - ARM Linux
2011-12-13 11:31 ` Linus Walleij
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).