public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* sparc64 build breakage...
@ 2009-01-22  1:15 David Miller
  2009-01-22  1:18 ` David Miller
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: David Miller @ 2009-01-22  1:15 UTC (permalink / raw)
  To: yinghai; +Cc: mpm, mingo, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: Text/Plain; charset=utf-8, Size: 1613 bytes --]


This change:

commit d7e51e66899f95dabc89b4d4c6674a6e50fa37fc
Author: Yinghai Lu <yinghai@kernel.org>
Date:   Wed Jan 7 15:03:13 2009 -0800

    sparseirq: make some func to be used with genirq

breaks the sparc64 build:

arch/sparc/kernel/irq_64.c: In function ‘show_interrupts’:
arch/sparc/kernel/irq_64.c:188: error: ‘struct kernel_stat’ has no member named ‘irqs’
make[1]: *** [arch/sparc/kernel/irq_64.o] Error 1

This should fix it:

sparc64: Fix build by using kstat_irqs_cpu().

Changeset d7e51e66899f95dabc89b4d4c6674a6e50fa37fc ("sparseirq: make
some func to be used with genirq") broke the build on sparc64:

arch/sparc/kernel/irq_64.c: In function ‘show_interrupts’:
arch/sparc/kernel/irq_64.c:188: error: ‘struct kernel_stat’ has no member named ‘irqs’
make[1]: *** [arch/sparc/kernel/irq_64.o] Error 1

Fix by using the kstat_irqs_cpu() interface.

Signed-off-by: David S. Miller <davem@davemloft.net>

diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c
index 4ac5c65..5b33d59 100644
--- a/arch/sparc/kernel/irq_64.c
+++ b/arch/sparc/kernel/irq_64.c
@@ -185,7 +185,7 @@ int show_interrupts(struct seq_file *p, void *v)
 		seq_printf(p, "%10u ", kstat_irqs(i));
 #else
 		for_each_online_cpu(j)
-			seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
+			seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
 #endif
 		seq_printf(p, " %9s", irq_desc[i].chip->typename);
 		seq_printf(p, "  %s", action->name);
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: sparc64 build breakage...
  2009-01-22  1:15 sparc64 build breakage David Miller
@ 2009-01-22  1:18 ` David Miller
  2009-01-22  1:24 ` David Miller
  2009-01-22  2:34 ` Yinghai Lu
  2 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2009-01-22  1:18 UTC (permalink / raw)
  To: yinghai; +Cc: mpm, mingo, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: Text/Plain; charset=utf-8, Size: 1222 bytes --]

From: David Miller <davem@davemloft.net>
Date: Wed, 21 Jan 2009 17:15:53 -0800 (PST)

> 
> This change:
> 
> commit d7e51e66899f95dabc89b4d4c6674a6e50fa37fc
> Author: Yinghai Lu <yinghai@kernel.org>
> Date:   Wed Jan 7 15:03:13 2009 -0800
> 
>     sparseirq: make some func to be used with genirq
> 
> breaks the sparc64 build:
 ...
> arch/sparc/kernel/irq_64.c: In function ‘show_interrupts’:
> arch/sparc/kernel/irq_64.c:188: error: ‘struct kernel_stat’ has no member named ‘irqs’
> make[1]: *** [arch/sparc/kernel/irq_64.o] Error 1
> 
> This should fix it:
> 
> sparc64: Fix build by using kstat_irqs_cpu().

Actually this isn't enough, next failure:

arch/sparc/kernel/time_64.c: In function ‘timer_interrupt’:
arch/sparc/kernel/time_64.c:732: error: implicit declaration of function ‘kstat_incr_irqs_this_cpu’
make[1]: *** [arch/sparc/kernel/time_64.o] Error 1

There seems to be a disconnect in linux/kernel_stat.h about
providing the same set of interfaces whether GENERIC_IRQS
is set or not.  kstat_incr_irqs_this_cpu is one example.
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: sparc64 build breakage...
  2009-01-22  1:15 sparc64 build breakage David Miller
  2009-01-22  1:18 ` David Miller
@ 2009-01-22  1:24 ` David Miller
  2009-01-22  8:11   ` Ingo Molnar
  2009-01-22  2:34 ` Yinghai Lu
  2 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2009-01-22  1:24 UTC (permalink / raw)
  To: yinghai; +Cc: mpm, mingo, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: Text/Plain; charset=utf-8, Size: 1650 bytes --]

From: David Miller <davem@davemloft.net>
Date: Wed, 21 Jan 2009 17:15:53 -0800 (PST)

> 
> This change:
> 
> commit d7e51e66899f95dabc89b4d4c6674a6e50fa37fc
> Author: Yinghai Lu <yinghai@kernel.org>
> Date:   Wed Jan 7 15:03:13 2009 -0800
> 
>     sparseirq: make some func to be used with genirq
> 
> breaks the sparc64 build:
..
> This should fix it:
> 
> sparc64: Fix build by using kstat_irqs_cpu().

And here is a mix for the next failure.

But really, either linux/kernel_stat.h provides the
kstat_incr_irqs_this_cpu interface or linux/irq.h does, not both.

sparc64: Fix build by including linux/irq.h into time_64.c

Changeset d7e51e66899f95dabc89b4d4c6674a6e50fa37fc ("sparseirq: make
some func to be used with genirq") broke the build on sparc64:
    
arch/sparc/kernel/time_64.c: In function ‘timer_interrupt’:
arch/sparc/kernel/time_64.c:732: error: implicit declaration of function ‘kstat_incr_irqs_this_cpu’
make[1]: *** [arch/sparc/kernel/time_64.o] Error 1

Signed-off-by: David S. Miller <davem@davemloft.net>

diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c
index db310aa..f95066b 100644
--- a/arch/sparc/kernel/time_64.c
+++ b/arch/sparc/kernel/time_64.c
@@ -36,10 +36,10 @@
 #include <linux/clocksource.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
+#include <linux/irq.h>
 
 #include <asm/oplib.h>
 #include <asm/timer.h>
-#include <asm/irq.h>
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/starfire.h>
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: sparc64 build breakage...
  2009-01-22  1:15 sparc64 build breakage David Miller
  2009-01-22  1:18 ` David Miller
  2009-01-22  1:24 ` David Miller
@ 2009-01-22  2:34 ` Yinghai Lu
  2 siblings, 0 replies; 7+ messages in thread
From: Yinghai Lu @ 2009-01-22  2:34 UTC (permalink / raw)
  To: David Miller; +Cc: mpm, mingo, linux-kernel

David Miller wrote:
> This change:
> 
> commit d7e51e66899f95dabc89b4d4c6674a6e50fa37fc
> Author: Yinghai Lu <yinghai@kernel.org>
> Date:   Wed Jan 7 15:03:13 2009 -0800
> 
>     sparseirq: make some func to be used with genirq
> 
> breaks the sparc64 build:
> 
> arch/sparc/kernel/irq_64.c: In function ‘show_interrupts’:
> arch/sparc/kernel/irq_64.c:188: error: ‘struct kernel_stat’ has no member named ‘irqs’
> make[1]: *** [arch/sparc/kernel/irq_64.o] Error 1
> 


sorry, i missed it. we didn't touch m68k, s390, sparc...
but forget sparc64 sparc are merged already.

arch/sparc/kernel/irq_32.c:                                 kstat_cpu(j).irqs[i]);
arch/sparc/kernel/irq_32.c:     kstat_cpu(cpu).irqs[irq]++;
arch/sparc/kernel/irq_32.c:     kstat_cpu(cpu).irqs[irq]++;
arch/sparc/kernel/irq_64.c:                     seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
arch/sparc/kernel/sun4d_irq.c:                         kstat_cpu(cpu_logical_map(x)).irqs[i]);
arch/sparc/kernel/sun4d_irq.c:  kstat_cpu(cpu).irqs[irq]++;

YH

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: sparc64 build breakage...
  2009-01-22  1:24 ` David Miller
@ 2009-01-22  8:11   ` Ingo Molnar
  2009-01-22  8:38     ` Yinghai Lu
  0 siblings, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2009-01-22  8:11 UTC (permalink / raw)
  To: David Miller; +Cc: yinghai, mpm, linux-kernel


* David Miller <davem@davemloft.net> wrote:

> From: David Miller <davem@davemloft.net>
> Date: Wed, 21 Jan 2009 17:15:53 -0800 (PST)
> 
> > 
> > This change:
> > 
> > commit d7e51e66899f95dabc89b4d4c6674a6e50fa37fc
> > Author: Yinghai Lu <yinghai@kernel.org>
> > Date:   Wed Jan 7 15:03:13 2009 -0800
> > 
> >     sparseirq: make some func to be used with genirq
> > 
> > breaks the sparc64 build:
> ..
> > This should fix it:
> > 
> > sparc64: Fix build by using kstat_irqs_cpu().
> 
> And here is a mix for the next failure.

Applied your fixes to tip/irq/sparseirq:

 e81838d: sparc64: Fix build by using kstat_irqs_cpu()
 623d3f0: sparc64: Fix build by including linux/irq.h into time_64.c

thanks David!

> But really, either linux/kernel_stat.h provides the 
> kstat_incr_irqs_this_cpu interface or linux/irq.h does, not both.

Yes, but every time someone tries to clean those dependencies up, it gets 
held up by non-genirq architectures:

 /*
  * Please do not include this file in generic code.  There is currently
  * no requirement for any architecture to implement anything held
  * within this file.
  *
  * Thanks. --rmk
  */

Meanwhile that particular comment is moot because ARM is genirq - but 
there's a handful of other non-genirq architectures so this area of code 
continues to be a mess.

I guess we could move all the APIs to kernel_stat.h. Yinghai?

	Ingo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: sparc64 build breakage...
  2009-01-22  8:11   ` Ingo Molnar
@ 2009-01-22  8:38     ` Yinghai Lu
  2009-01-22  9:20       ` Ingo Molnar
  0 siblings, 1 reply; 7+ messages in thread
From: Yinghai Lu @ 2009-01-22  8:38 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: David Miller, mpm, linux-kernel

Ingo Molnar wrote:
> * David Miller <davem@davemloft.net> wrote:
> 
>> From: David Miller <davem@davemloft.net>
>> Date: Wed, 21 Jan 2009 17:15:53 -0800 (PST)
>>
>>> This change:
>>>
>>> commit d7e51e66899f95dabc89b4d4c6674a6e50fa37fc
>>> Author: Yinghai Lu <yinghai@kernel.org>
>>> Date:   Wed Jan 7 15:03:13 2009 -0800
>>>
>>>     sparseirq: make some func to be used with genirq
>>>
>>> breaks the sparc64 build:
>> ..
>>> This should fix it:
>>>
>>> sparc64: Fix build by using kstat_irqs_cpu().
>> And here is a mix for the next failure.
> 
> Applied your fixes to tip/irq/sparseirq:
> 
>  e81838d: sparc64: Fix build by using kstat_irqs_cpu()
>  623d3f0: sparc64: Fix build by including linux/irq.h into time_64.c
> 
> thanks David!
> 
>> But really, either linux/kernel_stat.h provides the 
>> kstat_incr_irqs_this_cpu interface or linux/irq.h does, not both.
> 
> Yes, but every time someone tries to clean those dependencies up, it gets 
> held up by non-genirq architectures:
> 
>  /*
>   * Please do not include this file in generic code.  There is currently
>   * no requirement for any architecture to implement anything held
>   * within this file.
>   *
>   * Thanks. --rmk
>   */
> 
> Meanwhile that particular comment is moot because ARM is genirq - but 
> there's a handful of other non-genirq architectures so this area of code 
> continues to be a mess.
> 
> I guess we could move all the APIs to kernel_stat.h. Yinghai?

sth like:

diff --git a/include/linux/irq.h b/include/linux/irq.h
index 5d6ad5d..7977d54 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -202,12 +202,6 @@ extern struct irq_desc irq_desc[NR_IRQS];
 extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu);
 #endif /* CONFIG_SPARSE_IRQ */
 
-#define kstat_irqs_this_cpu(DESC) \
-	((DESC)->kstat_irqs[smp_processor_id()])
-#define kstat_incr_irqs_this_cpu(irqno, DESC) \
-	((DESC)->kstat_irqs[smp_processor_id()]++)
-
-
 extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu);
 
 static inline struct irq_desc *
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index 51d2129..b6d2887 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -52,16 +52,19 @@ static inline void kstat_incr_irqs_this_cpu(unsigned int irq,
 {
 	kstat_this_cpu.irqs[irq]++;
 }
-#endif
-
 
-#ifndef CONFIG_GENERIC_HARDIRQS
 static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
 {
        return kstat_cpu(cpu).irqs[irq];
 }
 #else
+#include <linux/irq.h>
 extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu);
+#define kstat_irqs_this_cpu(DESC) \
+	((DESC)->kstat_irqs[smp_processor_id()])
+#define kstat_incr_irqs_this_cpu(irqno, DESC) \
+	((DESC)->kstat_irqs[smp_processor_id()]++)
+
 #endif
 
 /*

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: sparc64 build breakage...
  2009-01-22  8:38     ` Yinghai Lu
@ 2009-01-22  9:20       ` Ingo Molnar
  0 siblings, 0 replies; 7+ messages in thread
From: Ingo Molnar @ 2009-01-22  9:20 UTC (permalink / raw)
  To: Yinghai Lu; +Cc: David Miller, mpm, linux-kernel


* Yinghai Lu <yinghai@kernel.org> wrote:

> > Meanwhile that particular comment is moot because ARM is genirq - but 
> > there's a handful of other non-genirq architectures so this area of code 
> > continues to be a mess.
> > 
> > I guess we could move all the APIs to kernel_stat.h. Yinghai?
> 
> sth like:

yes. I've applied your cleanup to irq/sparseirq [see the commit below] and 
started doing some build testing to see what the general impact is.

	Ingo

-------------------->
>From d52a61c04c6c0814ca270a088feedb126436598e Mon Sep 17 00:00:00 2001
From: Yinghai Lu <yinghai@kernel.org>
Date: Thu, 22 Jan 2009 00:38:56 -0800
Subject: [PATCH] irq: clean up irq stat methods

David Miller suggested, related to a kstat_irqs related build breakage:

> Either linux/kernel_stat.h provides the kstat_incr_irqs_this_cpu
> interface or linux/irq.h does, not both.

So move them to kernel_stat.h.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 include/linux/irq.h         |    6 ------
 include/linux/kernel_stat.h |    9 ++++++---
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/include/linux/irq.h b/include/linux/irq.h
index e9a8789..48901e9 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -202,12 +202,6 @@ extern struct irq_desc irq_desc[NR_IRQS];
 extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu);
 #endif /* CONFIG_SPARSE_IRQ */
 
-#define kstat_irqs_this_cpu(DESC) \
-	((DESC)->kstat_irqs[smp_processor_id()])
-#define kstat_incr_irqs_this_cpu(irqno, DESC) \
-	((DESC)->kstat_irqs[smp_processor_id()]++)
-
-
 extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu);
 
 static inline struct irq_desc *
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index a3431b1..0c8b89f 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -52,16 +52,19 @@ static inline void kstat_incr_irqs_this_cpu(unsigned int irq,
 {
 	kstat_this_cpu.irqs[irq]++;
 }
-#endif
-
 
-#ifndef CONFIG_GENERIC_HARDIRQS
 static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
 {
        return kstat_cpu(cpu).irqs[irq];
 }
 #else
+#include <linux/irq.h>
 extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu);
+#define kstat_irqs_this_cpu(DESC) \
+	((DESC)->kstat_irqs[smp_processor_id()])
+#define kstat_incr_irqs_this_cpu(irqno, DESC) \
+	((DESC)->kstat_irqs[smp_processor_id()]++)
+
 #endif
 
 /*

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-01-22  9:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-22  1:15 sparc64 build breakage David Miller
2009-01-22  1:18 ` David Miller
2009-01-22  1:24 ` David Miller
2009-01-22  8:11   ` Ingo Molnar
2009-01-22  8:38     ` Yinghai Lu
2009-01-22  9:20       ` Ingo Molnar
2009-01-22  2:34 ` Yinghai Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox