All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: adeos-main <adeos-main@gna.org>
Cc: Philippe Gerum <rpm@xenomai.org>
Subject: [Adeos-main] [PATCH 1/3] i386: fix tracking of __ipipe_tick_irq
Date: Wed, 26 Dec 2007 16:40:22 +0100	[thread overview]
Message-ID: <477275E6.9090306@domain.hid> (raw)


[-- 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 --]

                 reply	other threads:[~2007-12-26 15:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=477275E6.9090306@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=adeos-main@gna.org \
    --cc=rpm@xenomai.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 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.