login
Header Space

 
 

Re: tick-common.c hack for s390 needed

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Heiko Carstens <heiko.carstens@...>
Cc: Thomas Gleixner <tglx@...>, Ingo Molnar <mingo@...>, Christoph Hellwig <hch@...>, <linux-kernel@...>, Martin Schwidefsky <schwidefsky@...>, <paulus@...>, <ralf@...>, <davem@...>, <lethal@...>, <jdike@...>
Date: Sunday, March 23, 2008 - 6:34 pm

On Sat, Mar 22, 2008 at 09:32:23PM +0100, Heiko Carstens wrote:

I generally dislike adding optional linux/* includes in asm/* includes -
I'm nervous about this causing include loops.

However, there's a separate point to be discussed here.

That is, what interfaces are expected of every architecture in the kernel.
If generic code wants to be able to set the affinity of interrupts, then
that needs to become part of the interfaces listed in linux/interrupt.h
rather than linux/irq.h.

So what I suggest is this approach instead (against Linus' tree of a
couple of days ago) - we move irq_set_affinity() and irq_can_set_affinity()
to linux/interrupt.h, change the linux/irq.h includes to linux/interrupt.h
and include asm/irq_regs.h where needed (asm/irq_regs.h is supposed to be
rarely used include since not much touches the stacked parent context
registers.)

Build tested on ARM PXA family kernels and ARM's Realview platform
kernels which both use genirq.

diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index f8ab4ce..355e3b0 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -102,6 +102,25 @@ extern void disable_irq_nosync(unsigned int irq);
 extern void disable_irq(unsigned int irq);
 extern void enable_irq(unsigned int irq);
 
+#ifdef CONFIG_SMP
+
+extern int irq_set_affinity(unsigned int irq, cpumask_t cpumask);
+extern int irq_can_set_affinity(unsigned int irq);
+
+#else /* CONFIG_SMP */
+
+static inline int irq_set_affinity(unsigned int irq, cpumask_t cpumask)
+{
+	return -EINVAL;
+}
+
+static inline int irq_can_set_affinity(unsigned int irq)
+{
+	return 0;
+}
+
+#endif /* CONFIG_SMP */
+
 #ifdef CONFIG_GENERIC_HARDIRQS
 /*
  * Special lockdep variants of irq disabling/enabling.
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 176e5e7..1883a85 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -228,21 +228,11 @@ static inline void set_pending_irq(unsigned int irq, cpumask_t mask)
 
 #endif /* CONFIG_GENERIC_PENDING_IRQ */
 
-extern int irq_set_affinity(unsigned int irq, cpumask_t cpumask);
-extern int irq_can_set_affinity(unsigned int irq);
-
 #else /* CONFIG_SMP */
 
 #define move_native_irq(x)
 #define move_masked_irq(x)
 
-static inline int irq_set_affinity(unsigned int irq, cpumask_t cpumask)
-{
-	return -EINVAL;
-}
-
-static inline int irq_can_set_affinity(unsigned int irq) { return 0; }
-
 #endif /* CONFIG_SMP */
 
 #ifdef CONFIG_IRQBALANCE
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index e1bd50c..fdfa0c7 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -14,7 +14,7 @@
 #include <linux/cpu.h>
 #include <linux/err.h>
 #include <linux/hrtimer.h>
-#include <linux/irq.h>
+#include <linux/interrupt.h>
 #include <linux/percpu.h>
 #include <linux/profile.h>
 #include <linux/sched.h>
diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c
index 1bea399..4f38865 100644
--- a/kernel/time/tick-common.c
+++ b/kernel/time/tick-common.c
@@ -14,12 +14,14 @@
 #include <linux/cpu.h>
 #include <linux/err.h>
 #include <linux/hrtimer.h>
-#include <linux/irq.h>
+#include <linux/interrupt.h>
 #include <linux/percpu.h>
 #include <linux/profile.h>
 #include <linux/sched.h>
 #include <linux/tick.h>
 
+#include <asm/irq_regs.h>
+
 #include "tick-internal.h"
 
 /*
diff --git a/kernel/time/tick-oneshot.c b/kernel/time/tick-oneshot.c
index 0258d31..450c049 100644
--- a/kernel/time/tick-oneshot.c
+++ b/kernel/time/tick-oneshot.c
@@ -14,7 +14,7 @@
 #include <linux/cpu.h>
 #include <linux/err.h>
 #include <linux/hrtimer.h>
-#include <linux/irq.h>
+#include <linux/interrupt.h>
 #include <linux/percpu.h>
 #include <linux/profile.h>
 #include <linux/sched.h>


-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
tick-common.c hack for s390 needed, Heiko Carstens, (Tue Mar 18, 5:31 am)
Re: tick-common.c hack for s390 needed, Arnd Bergmann, (Wed Mar 19, 12:12 am)
Re: tick-common.c hack for s390 needed, Christoph Hellwig, (Wed Mar 19, 1:45 am)
Re: tick-common.c hack for s390 needed, Ingo Molnar, (Fri Mar 21, 6:15 am)
Re: tick-common.c hack for s390 needed, Heiko Carstens, (Fri Mar 21, 9:25 am)
Re: tick-common.c hack for s390 needed, Thomas Gleixner, (Fri Mar 21, 10:45 am)
Re: tick-common.c hack for s390 needed, Heiko Carstens, (Sat Mar 22, 4:32 pm)
Re: tick-common.c hack for s390 needed, Russell King, (Sun Mar 23, 6:34 pm)
Re: tick-common.c hack for s390 needed, Thomas Gleixner, (Tue Mar 25, 3:09 pm)
Re: tick-common.c hack for s390 needed, Heiko Carstens, (Tue Apr 1, 7:02 am)
Re: tick-common.c hack for s390 needed, Thomas Gleixner, (Tue Apr 1, 7:24 am)
Re: tick-common.c hack for s390 needed, Russell King, (Tue Mar 25, 3:30 pm)
Re: tick-common.c hack for s390 needed, Heiko Carstens, (Mon Mar 24, 6:14 am)
speck-geostationary