Skip to contentSkip to conversation

sparc64 build breakage...

PATCH David Miller 3 participants 7 messages Jan 22, 2009

Subsystems (2)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

This change:

commit d7e51e66899f95dabc89b4d4c6674a6e50fa37fc

Author: Yinghai Lu <[email protected]>
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.

arch/sparc/kernel/irq_64.c +1 -1
index 4ac5c65..5b33d59 100644
@@ -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�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m���� ������?�I�

author maintainer
#1 lore raw

From: David Miller <[email protected]>
Date: Wed, 21 Jan 2009 17:15:53 -0800 (PST)

Quoted 10 lines

This change:

commit d7e51e66899f95dabc89b4d4c6674a6e50fa37fc

Author: Yinghai Lu <[email protected]>
Date:   Wed Jan 7 15:03:13 2009 -0800

sparseirq: make some func to be used with genirq

breaks the sparc64 build:

...

Quoted 7 lines

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�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m���� ������?�I�

author maintainer
#2 lore raw
In reply to David Miller

From: David Miller <[email protected]>
Date: Wed, 21 Jan 2009 17:15:53 -0800 (PST)

Quoted 10 lines

This change:

commit d7e51e66899f95dabc89b4d4c6674a6e50fa37fc

Author: Yinghai Lu <[email protected]>
Date:   Wed Jan 7 15:03:13 2009 -0800

sparseirq: make some func to be used with genirq

breaks the sparc64 build:

..

Quoted 3 lines

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

arch/sparc/kernel/time_64.c +1 -1
index db310aa..f95066b 100644
@@ -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�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m���� ������?�I�

#3 lore raw
Quoted 12 lines · David Miller

From: David Miller <[email protected]>
Date: Wed, 21 Jan 2009 17:15:53 -0800 (PST)

Quoted 9 lines

This change:

commit d7e51e66899f95dabc89b4d4c6674a6e50fa37fc

Author: Yinghai Lu <[email protected]>
Date:   Wed Jan 7 15:03:13 2009 -0800

sparseirq: make some func to be used with genirq

Quoted 7 lines
Quoted 1 line

breaks the sparc64 build:

..

Quoted 3 lines

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!

Quoted 2 lines

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

#4 lore raw
Quoted 41 lines · Ingo Molnar
Quoted 9 lines · David Miller

From: David Miller <[email protected]>
Date: Wed, 21 Jan 2009 17:15:53 -0800 (PST)

Quoted 6 lines

This change:

commit d7e51e66899f95dabc89b4d4c6674a6e50fa37fc

Author: Yinghai Lu <[email protected]>
Date:   Wed Jan 7 15:03:13 2009 -0800
Quoted 8 lines
Quoted 3 lines

sparseirq: make some func to be used with genirq

breaks the sparc64 build:

..

Quoted 3 lines

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!

Quoted 2 lines

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

Quoted 5 lines

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:

include/linux/irq.h +0 -6
index 5d6ad5d..7977d54 100644
@@ -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 *
include/linux/kernel_stat.h +6 -3
index 51d2129..b6d2887 100644
@@ -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
 
 /*
#5 lore raw
Quoted 7 lines · Yinghai Lu
Quoted 5 lines

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

-------------------->

Quoted 1 line

From d52a61c04c6c0814ca270a088feedb126436598e Mon Sep 17 00:00:00 2001

From: Yinghai Lu <[email protected]>
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:

Quoted 2 lines

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.

---
 include/linux/irq.h         |    6 ------
 include/linux/kernel_stat.h |    9 ++++++---
 2 files changed, 6 insertions(+), 9 deletions(-)
include/linux/irq.h +0 -6
index e9a8789..48901e9 100644
@@ -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 *
include/linux/kernel_stat.h +6 -3
index a3431b1..0c8b89f 100644
@@ -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
 
 /*
#6 lore raw
In reply to David Miller
Quoted 6 lines · David Miller

This change:

commit d7e51e66899f95dabc89b4d4c6674a6e50fa37fc

Author: Yinghai Lu <[email protected]>
Date:   Wed Jan 7 15:03:13 2009 -0800
Quoted 8 lines

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