* [PATCH 3/3] Allow setup_irq call for VPE1 timer.
@ 2010-11-25 15:07 Anoop P
2010-12-01 11:24 ` Ralf Baechle
0 siblings, 1 reply; 2+ messages in thread
From: Anoop P @ 2010-11-25 15:07 UTC (permalink / raw)
To: linux-mips, dvomlehn
Cc: Anoop P A, Ralf Baechle, David Howells, Thomas Gleixner,
David Daney, linux-kernel
From: Anoop P A <anoop.pa@gmail.com>
VSMP configuration can have seperate timer interrupts for each VPE.Need to setup IRQ for VPE1 timer.
Signed-off-by: Anoop P A <anoop.pa@gmail.com>
---
arch/mips/kernel/cevt-r4k.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c
index 2f4d7a9..7eaeacd 100644
--- a/arch/mips/kernel/cevt-r4k.c
+++ b/arch/mips/kernel/cevt-r4k.c
@@ -203,9 +203,10 @@ int __cpuinit r4k_clockevent_init(void)
clockevents_register_device(cd);
+#ifndef CONFIG_MIPS_MT_SMP
if (cp0_timer_irq_installed)
return 0;
-
+#endif
cp0_timer_irq_installed = 1;
setup_irq(irq, &c0_compare_irqaction);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 3/3] Allow setup_irq call for VPE1 timer.
2010-11-25 15:07 [PATCH 3/3] Allow setup_irq call for VPE1 timer Anoop P
@ 2010-12-01 11:24 ` Ralf Baechle
0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2010-12-01 11:24 UTC (permalink / raw)
To: Anoop P
Cc: linux-mips, dvomlehn, David Howells, Thomas Gleixner, David Daney,
linux-kernel
On Thu, Nov 25, 2010 at 08:37:12PM +0530, Anoop P wrote:
> From: Anoop P A <anoop.pa@gmail.com>
>
> VSMP configuration can have seperate timer interrupts for each VPE.Need to setup IRQ for VPE1 timer.
> +#ifndef CONFIG_MIPS_MT_SMP
> if (cp0_timer_irq_installed)
> return 0;
> -
> +#endif
> cp0_timer_irq_installed = 1;
>
> setup_irq(irq, &c0_compare_irqaction);
On the stylistic side adding an #ifdef gives me wrinkles.
With CONFIG_MIPS_MT_SMP this patch results in sharing c0_compare_irqaction
between multiple interrupts which is broken. Struct irqaction contains
the interrupt number, all registered irqaction structs are part of a chained
list via its ->next member and also there is a per interrupt proc directory.
To fix this properly you'll have to introduce do a bit of bookkeeping - you
want to register each interrupt only once - and allocate a struct irqaction
per registered timer interrupt.
The allocation is made a little trickier by kmalloc not being available
yet by the time this code is getting invoked via time_init() so you'll
have to move it to run via the late_time_init hook like x86:
static __init void x86_late_time_init(void)
{
... do the real work ...
}
/* ... */
void __init time_init(void)
{
late_time_init = x86_late_time_init;
}
Which makes me wonder if there is a reason why we need to have both
time_init() and late_time_init() - can't we just move the time_init()?
Ralf
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-12-01 11:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-25 15:07 [PATCH 3/3] Allow setup_irq call for VPE1 timer Anoop P
2010-12-01 11:24 ` Ralf Baechle
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).