2008-03-18 09:31:32

by Heiko Carstens

[permalink] [raw]
Subject: tick-common.c hack for s390 needed

Hi Thomas, Ingo,

I'm converting s390 from s390's NO_IDLE_HZ to GENERIC_CLOCKEVENTS and
therefore to the generic NO_HZ implementation.
One of the problems that need a patch for this is kernel/time/tick-common.c
which relies on the irq stuff present in include/linux/irq.h.
In particular s390 doesn't have something like irq_set_affinity which
causes this build error:

CC kernel/time/tick-common.o
kernel/time/tick-common.c: In function 'tick_periodic':
kernel/time/tick-common.c:70: error: implicit declaration of function 'get_irq_regs'
kernel/time/tick-common.c:70: error: invalid type argument of '->' (have 'int')
kernel/time/tick-common.c: In function 'tick_setup_device':
kernel/time/tick-common.c:171: error: implicit declaration of function 'irq_set_affinity'
kernel/time/tick-common.c: In function 'tick_check_new_device':
kernel/time/tick-common.c:216: error: implicit declaration of function 'irq_can_set_affinity'

Actually there's a huge #ifndef CONFIG_S390 in linux/irq.h ;)

To make the code work the patch below is necessary. It's ok since all
clock event devices on s390 are per cpu. However I think this patch is
ugly at best. Any ideas how to fix this in a better and more generic way?

---
kernel/time/tick-common.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

Index: linux-2.6/kernel/time/tick-common.c
===================================================================
--- linux-2.6.orig/kernel/time/tick-common.c
+++ linux-2.6/kernel/time/tick-common.c
@@ -19,6 +19,7 @@
#include <linux/profile.h>
#include <linux/sched.h>
#include <linux/tick.h>
+#include <asm/irq_regs.h>

#include "tick-internal.h"

@@ -167,9 +168,10 @@ static void tick_setup_device(struct tic
* When the device is not per cpu, pin the interrupt to the
* current cpu:
*/
+#ifndef CONFIG_S390
if (!cpus_equal(newdev->cpumask, cpumask))
irq_set_affinity(newdev->irq, cpumask);
-
+#endif
/*
* When global broadcasting is active, check if the current
* device is registered as a placeholder for broadcast mode.
@@ -213,9 +215,10 @@ static int tick_check_new_device(struct
* If the cpu affinity of the device interrupt can not
* be set, ignore it.
*/
+#ifndef CONFIG_S390
if (!irq_can_set_affinity(newdev->irq))
goto out_bc;
-
+#endif
/*
* If we have a cpu local device already, do not replace it
* by a non cpu local device


2008-03-19 22:30:51

by Christoph Hellwig

[permalink] [raw]
Subject: Re: tick-common.c hack for s390 needed

On Tue, Mar 18, 2008 at 10:31:19AM +0100, Heiko Carstens wrote:
> Hi Thomas, Ingo,
>
> I'm converting s390 from s390's NO_IDLE_HZ to GENERIC_CLOCKEVENTS and
> therefore to the generic NO_HZ implementation.
> One of the problems that need a patch for this is kernel/time/tick-common.c
> which relies on the irq stuff present in include/linux/irq.h.
> In particular s390 doesn't have something like irq_set_affinity which
> causes this build error:

Generic code must never use linux/irq.h - it's more like asm-generic
file predating asm-generic.

2008-03-19 23:08:11

by Arnd Bergmann

[permalink] [raw]
Subject: Re: tick-common.c hack for s390 needed

On Tuesday 18 March 2008, Heiko Carstens wrote:
> Actually there's a huge #ifndef CONFIG_S390 in linux/irq.h ;)
>
> To make the code work the patch below is necessary. It's ok since all
> clock event devices on s390 are per cpu. However I think this patch is
> ugly at best. Any ideas how to fix this in a better and more generic way?

You could have an #else path in linux/irq.h to just define these
functions as s390, maybe like

static inline int irq_set_affinity(unsigned int irq, cpumask_t cpumask)
{
BUG();
return 0;
}
static inline int irq_can_set_affinity(unsigned int irq)
{
return 0;
}

Arnd <><

2008-03-21 10:15:30

by Ingo Molnar

[permalink] [raw]
Subject: Re: tick-common.c hack for s390 needed


* Christoph Hellwig <[email protected]> wrote:

> On Tue, Mar 18, 2008 at 10:31:19AM +0100, Heiko Carstens wrote:
> > Hi Thomas, Ingo,
> >
> > I'm converting s390 from s390's NO_IDLE_HZ to GENERIC_CLOCKEVENTS and
> > therefore to the generic NO_HZ implementation.
> > One of the problems that need a patch for this is kernel/time/tick-common.c
> > which relies on the irq stuff present in include/linux/irq.h.
> > In particular s390 doesn't have something like irq_set_affinity which
> > causes this build error:
>
> Generic code must never use linux/irq.h - it's more like asm-generic
> file predating asm-generic.

agreed.

Heiko, if you remove all these:

./time/tick-broadcast.c:#include <linux/irq.h>
./time/tick-oneshot.c:#include <linux/irq.h>
./time/tick-common.c:#include <linux/irq.h>
./hrtimer.c:#include <linux/irq.h>

from kernel/*, do things improve on s390? If yes then please send a
patch for it and i'll check whether there's any include file dependency
fallout on x86.

Ingo

2008-03-21 13:26:18

by Heiko Carstens

[permalink] [raw]
Subject: Re: tick-common.c hack for s390 needed

On Fri, Mar 21, 2008 at 11:15:04AM +0100, Ingo Molnar wrote:
>
> * Christoph Hellwig <[email protected]> wrote:
>
> > On Tue, Mar 18, 2008 at 10:31:19AM +0100, Heiko Carstens wrote:
> > > Hi Thomas, Ingo,
> > >
> > > I'm converting s390 from s390's NO_IDLE_HZ to GENERIC_CLOCKEVENTS and
> > > therefore to the generic NO_HZ implementation.
> > > One of the problems that need a patch for this is kernel/time/tick-common.c
> > > which relies on the irq stuff present in include/linux/irq.h.
> > > In particular s390 doesn't have something like irq_set_affinity which
> > > causes this build error:
> >
> > Generic code must never use linux/irq.h - it's more like asm-generic
> > file predating asm-generic.
>
> agreed.
>
> Heiko, if you remove all these:
>
> ./time/tick-broadcast.c:#include <linux/irq.h>
> ./time/tick-oneshot.c:#include <linux/irq.h>
> ./time/tick-common.c:#include <linux/irq.h>
> ./hrtimer.c:#include <linux/irq.h>
>
> from kernel/*, do things improve on s390? If yes then please send a
> patch for it and i'll check whether there's any include file dependency
> fallout on x86.

No, tick-common.c has calls to irq_set_affinity and irq_can_set_affinity, for
which the prototypes are in linux/irq.h.
Each and every architecture seems to include linux/irq.h from a different file
in asm-[your-favourite-arch]/*.h. I was able to fix the build breakage on x86
by adding an include <linux/interrupt.h>. But that won't work on other
architectures.
>From a logical point of view I would expect that asm/irq.h is supposed to
include linux/irq.h, no?

The patch below removes at least three of the includes for a beginning.
Still compiles on s390 and x86_64.

Subject: [PATCH] time: remove include/irq.h.

From: Heiko Carstens <[email protected]>

Generic code is not supposed to include linux/irq.h.

Signed-off-by: Heiko Carstens <[email protected]>
---

kernel/hrtimer.c | 1 -
kernel/time/tick-broadcast.c | 1 -
kernel/time/tick-oneshot.c | 1 -
3 files changed, 3 deletions(-)

Index: linux-2.6/kernel/hrtimer.c
===================================================================
--- linux-2.6.orig/kernel/hrtimer.c
+++ linux-2.6/kernel/hrtimer.c
@@ -32,7 +32,6 @@
*/

#include <linux/cpu.h>
-#include <linux/irq.h>
#include <linux/module.h>
#include <linux/percpu.h>
#include <linux/hrtimer.h>
Index: linux-2.6/kernel/time/tick-broadcast.c
===================================================================
--- linux-2.6.orig/kernel/time/tick-broadcast.c
+++ linux-2.6/kernel/time/tick-broadcast.c
@@ -14,7 +14,6 @@
#include <linux/cpu.h>
#include <linux/err.h>
#include <linux/hrtimer.h>
-#include <linux/irq.h>
#include <linux/percpu.h>
#include <linux/profile.h>
#include <linux/sched.h>
Index: linux-2.6/kernel/time/tick-oneshot.c
===================================================================
--- linux-2.6.orig/kernel/time/tick-oneshot.c
+++ linux-2.6/kernel/time/tick-oneshot.c
@@ -14,7 +14,6 @@
#include <linux/cpu.h>
#include <linux/err.h>
#include <linux/hrtimer.h>
-#include <linux/irq.h>
#include <linux/percpu.h>
#include <linux/profile.h>
#include <linux/sched.h>

2008-03-21 14:46:26

by Thomas Gleixner

[permalink] [raw]
Subject: Re: tick-common.c hack for s390 needed

On Fri, 21 Mar 2008, Heiko Carstens wrote:
>
> The patch below removes at least three of the includes for a beginning.
> Still compiles on s390 and x86_64.
>
> Subject: [PATCH] time: remove include/irq.h.
>
> From: Heiko Carstens <[email protected]>
>
> Generic code is not supposed to include linux/irq.h.
>
> Signed-off-by: Heiko Carstens <[email protected]>

Applied, thanks,

tglx

2008-03-22 20:32:38

by Heiko Carstens

[permalink] [raw]
Subject: Re: tick-common.c hack for s390 needed

On Fri, Mar 21, 2008 at 03:45:52PM +0100, Thomas Gleixner wrote:
> On Fri, 21 Mar 2008, Heiko Carstens wrote:
> >
> > The patch below removes at least three of the includes for a beginning.
> > Still compiles on s390 and x86_64.
> >
> > Subject: [PATCH] time: remove include/irq.h.
> >
> > From: Heiko Carstens <[email protected]>
> >
> > Generic code is not supposed to include linux/irq.h.
> >
> > Signed-off-by: Heiko Carstens <[email protected]>
>
> Applied, thanks,

And here comes the second part...

Subject: [PATCH] time: remove include/irq.h from tick-common.c

From: Heiko Carstens <[email protected]>

Generic code is not supposed to include irq.h. Replace this include
by linux/hardirq.h instead and add/replace an include of linux/irq.h
in asm header files where necessary.
This change should only matter for architectures that make use of
GENERIC_CLOCKEVENTS.
Architectures in question are mips, x86, arm, sh, powerpc, uml and sparc64.

I did some cross compile tests for mips, x86_64, arm, powerpc and sparc64.
This patch fixes also build breakages caused by the include replacement in
tick-common.h.

I didn't test uml and sh.

Signed-off-by: Heiko Carstens <[email protected]>
---
include/asm-arm/hardirq.h | 2 +-
include/asm-powerpc/hardirq.h | 2 +-
include/asm-sparc64/hardirq.h | 1 +
include/asm-sparc64/irq.h | 1 -
kernel/time/tick-common.c | 2 +-
5 files changed, 4 insertions(+), 4 deletions(-)

Index: linux-2.6/include/asm-arm/hardirq.h
===================================================================
--- linux-2.6.orig/include/asm-arm/hardirq.h
+++ linux-2.6/include/asm-arm/hardirq.h
@@ -3,7 +3,7 @@

#include <linux/cache.h>
#include <linux/threads.h>
-#include <asm/irq.h>
+#include <linux/irq.h>

typedef struct {
unsigned int __softirq_pending;
Index: linux-2.6/include/asm-powerpc/hardirq.h
===================================================================
--- linux-2.6.orig/include/asm-powerpc/hardirq.h
+++ linux-2.6/include/asm-powerpc/hardirq.h
@@ -2,7 +2,7 @@
#define _ASM_POWERPC_HARDIRQ_H
#ifdef __KERNEL__

-#include <asm/irq.h>
+#include <linux/irq.h>
#include <asm/bug.h>

/* The __last_jiffy_stamp field is needed to ensure that no decrementer
Index: linux-2.6/include/asm-sparc64/hardirq.h
===================================================================
--- linux-2.6.orig/include/asm-sparc64/hardirq.h
+++ linux-2.6/include/asm-sparc64/hardirq.h
@@ -6,6 +6,7 @@
#ifndef __SPARC64_HARDIRQ_H
#define __SPARC64_HARDIRQ_H

+#include <linux/irq.h>
#include <asm/cpudata.h>

#define __ARCH_IRQ_STAT
Index: linux-2.6/kernel/time/tick-common.c
===================================================================
--- linux-2.6.orig/kernel/time/tick-common.c
+++ linux-2.6/kernel/time/tick-common.c
@@ -14,7 +14,7 @@
#include <linux/cpu.h>
#include <linux/err.h>
#include <linux/hrtimer.h>
-#include <linux/irq.h>
+#include <linux/hardirq.h>
#include <linux/percpu.h>
#include <linux/profile.h>
#include <linux/sched.h>
Index: linux-2.6/include/asm-sparc64/irq.h
===================================================================
--- linux-2.6.orig/include/asm-sparc64/irq.h
+++ linux-2.6/include/asm-sparc64/irq.h
@@ -10,7 +10,6 @@
#include <linux/linkage.h>
#include <linux/kernel.h>
#include <linux/errno.h>
-#include <linux/interrupt.h>
#include <asm/pil.h>
#include <asm/ptrace.h>

2008-03-23 22:41:34

by Russell King

[permalink] [raw]
Subject: Re: tick-common.c hack for s390 needed

On Sat, Mar 22, 2008 at 09:32:23PM +0100, Heiko Carstens wrote:
> Generic code is not supposed to include irq.h. Replace this include
> by linux/hardirq.h instead and add/replace an include of linux/irq.h
> in asm header files where necessary.
> This change should only matter for architectures that make use of
> GENERIC_CLOCKEVENTS.
> Architectures in question are mips, x86, arm, sh, powerpc, uml and sparc64.
>
> I did some cross compile tests for mips, x86_64, arm, powerpc and sparc64.
> This patch fixes also build breakages caused by the include replacement in
> tick-common.h.

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:

2008-03-24 10:14:46

by Heiko Carstens

[permalink] [raw]
Subject: Re: tick-common.c hack for s390 needed

On Sun, Mar 23, 2008 at 10:34:55PM +0000, Russell King wrote:
> On Sat, Mar 22, 2008 at 09:32:23PM +0100, Heiko Carstens wrote:
> > Generic code is not supposed to include irq.h. Replace this include
> > by linux/hardirq.h instead and add/replace an include of linux/irq.h
> > in asm header files where necessary.
> > This change should only matter for architectures that make use of
> > GENERIC_CLOCKEVENTS.
> > Architectures in question are mips, x86, arm, sh, powerpc, uml and sparc64.
> >
> > I did some cross compile tests for mips, x86_64, arm, powerpc and sparc64.
> > This patch fixes also build breakages caused by the include replacement in
> > tick-common.h.
>
> 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.

Every architecture besides one... as usual :/

> 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 */
> +

Could you add something like

#ifdef CONFIG_GENERIC_HARDIRQS

/* added stuff from above */

#else /* CONFIG_GENERIC_HARDIRQS */

static inline int irq_set_affinity(unsigned int irq, cpumask_t cpumask)
{
WARN_ON(1);
return -EINVAL;
}

static inline int irq_can_set_affinity(unsigned int irq)
{
return 0;
}
#endif /* CONFIG_GENERIC_HARDIRQS */

Then it should do the right thing on s390 as well.

2008-03-25 19:12:37

by Thomas Gleixner

[permalink] [raw]
Subject: Re: tick-common.c hack for s390 needed

On Sun, 23 Mar 2008, Russell King wrote:

> On Sat, Mar 22, 2008 at 09:32:23PM +0100, Heiko Carstens wrote:
> > Generic code is not supposed to include irq.h. Replace this include
> > by linux/hardirq.h instead and add/replace an include of linux/irq.h
> > in asm header files where necessary.
> > This change should only matter for architectures that make use of
> > GENERIC_CLOCKEVENTS.
> > Architectures in question are mips, x86, arm, sh, powerpc, uml and sparc64.
> >
> > I did some cross compile tests for mips, x86_64, arm, powerpc and sparc64.
> > This patch fixes also build breakages caused by the include replacement in
> > tick-common.h.
>
> 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.)

That patch makes a lot of sense and resolves all the issues.

I push it through hrt.git and add the GENERIC_HARDIRQS dependency
which was requested by Heiko.

Thanks,

tglx

> 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:
>

2008-03-25 19:37:19

by Russell King

[permalink] [raw]
Subject: Re: tick-common.c hack for s390 needed

On Tue, Mar 25, 2008 at 08:09:15PM +0100, Thomas Gleixner wrote:
> On Sun, 23 Mar 2008, Russell King wrote:
>
> > On Sat, Mar 22, 2008 at 09:32:23PM +0100, Heiko Carstens wrote:
> > > Generic code is not supposed to include irq.h. Replace this include
> > > by linux/hardirq.h instead and add/replace an include of linux/irq.h
> > > in asm header files where necessary.
> > > This change should only matter for architectures that make use of
> > > GENERIC_CLOCKEVENTS.
> > > Architectures in question are mips, x86, arm, sh, powerpc, uml and sparc64.
> > >
> > > I did some cross compile tests for mips, x86_64, arm, powerpc and sparc64.
> > > This patch fixes also build breakages caused by the include replacement in
> > > tick-common.h.
> >
> > 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.)
>
> That patch makes a lot of sense and resolves all the issues.
>
> I push it through hrt.git and add the GENERIC_HARDIRQS dependency
> which was requested by Heiko.

Okay. Signed-off-by: Russell King <[email protected]>

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: