All of lore.kernel.org
 help / color / mirror / Atom feed
* [Adeos-main] [PATCH 1/3] i386: fix tracking of __ipipe_tick_irq
@ 2007-12-26 15:40 Jan Kiszka
  0 siblings, 0 replies; only message in thread
From: Jan Kiszka @ 2007-12-26 15:40 UTC (permalink / raw)
  To: adeos-main; +Cc: Philippe Gerum


[-- Attachment #1.1: Type: text/plain, Size: 246 bytes --]

The existing algorithm to track the Linux tick IRQ breaks when other
clockevent drivers than PIT or LAPIC are involved (HPET...?). This patch
fixes the logic by pushing updates to the spot where they occur - into
the clockevent layer.

Jan

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: fix-ipipe_tick_irq-definition-i386.patch --]
[-- Type: text/x-patch; name="fix-ipipe_tick_irq-definition-i386.patch", Size: 2673 bytes --]

---
 arch/i386/kernel/ipipe.c  |   11 +----------
 include/asm-i386/ipipe.h  |   17 ++++++++++++++++-
 kernel/time/tick-common.c |    4 ++++
 3 files changed, 21 insertions(+), 11 deletions(-)

Index: linux-2.6.23.12-xeno/arch/i386/kernel/ipipe.c
===================================================================
--- linux-2.6.23.12-xeno.orig/arch/i386/kernel/ipipe.c
+++ linux-2.6.23.12-xeno/arch/i386/kernel/ipipe.c
@@ -50,9 +50,7 @@
 
 extern struct clock_event_device *global_clock_event;
 
-extern struct clock_event_device pit_clockevent;
-
-int __ipipe_tick_irq;
+int __ipipe_tick_irq = TIMER_IRQ;
 
 DEFINE_PER_CPU(struct pt_regs, __ipipe_tick_regs);
 
@@ -220,13 +218,6 @@ void __init __ipipe_enable_pipeline(void
 			     IPIPE_STDROOT_MASK);
 #endif /* CONFIG_X86_MCE_P4THERMAL */
 
-	__ipipe_tick_irq = global_clock_event == &pit_clockevent ? 0
-		: ipipe_apic_vector_irq(LOCAL_TIMER_VECTOR);
-
-#else	/* !CONFIG_X86_LOCAL_APIC */
-
-	__ipipe_tick_irq = 0;
-
 #endif	/* CONFIG_X86_LOCAL_APIC */
 
 #ifdef CONFIG_SMP
Index: linux-2.6.23.12-xeno/include/asm-i386/ipipe.h
===================================================================
--- linux-2.6.23.12-xeno.orig/include/asm-i386/ipipe.h
+++ linux-2.6.23.12-xeno/include/asm-i386/ipipe.h
@@ -107,6 +107,20 @@ void __ipipe_do_critical_sync(unsigned i
 
 extern int __ipipe_tick_irq;
 
+#ifdef CONFIG_X86_LOCAL_APIC
+#define ipipe_update_tick_evtdev(evtdev)				\
+	do {								\
+		if (strcmp((evtdev)->name, "lapic") == 0)		\
+			__ipipe_tick_irq =				\
+				ipipe_apic_vector_irq(LOCAL_TIMER_VECTOR); \
+		else							\
+			__ipipe_tick_irq = TIMER_IRQ;			\
+	} while (0)
+#else
+#define ipipe_update_tick_evtdev(evtdev)				\
+	__ipipe_tick_irq = TIMER_IRQ
+#endif
+
 DECLARE_PER_CPU(struct pt_regs, __ipipe_tick_regs);
 
 #define __ipipe_call_root_xirq_handler(ipd,irq) \
@@ -205,7 +219,8 @@ int __ipipe_check_tickdev(const char *de
 
 #else /* !CONFIG_IPIPE */
 
-#define task_hijacked(p)	0
+#define ipipe_update_tick_evtdev(evtdev)	do { } while (0)
+#define task_hijacked(p)			0
 
 #endif /* CONFIG_IPIPE */
 
Index: linux-2.6.23.12-xeno/kernel/time/tick-common.c
===================================================================
--- linux-2.6.23.12-xeno.orig/kernel/time/tick-common.c
+++ linux-2.6.23.12-xeno/kernel/time/tick-common.c
@@ -163,6 +163,10 @@ static void tick_setup_device(struct tic
 
 	td->evtdev = newdev;
 
+	/* I-pipe: derive global tick IRQ from CPU 0 */
+	if (cpu == 0)
+		ipipe_update_tick_evtdev(newdev);
+
 	/*
 	 * When the device is not per cpu, pin the interrupt to the
 	 * current cpu:

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-12-26 15:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-26 15:40 [Adeos-main] [PATCH 1/3] i386: fix tracking of __ipipe_tick_irq Jan Kiszka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.