Skip to contentSkip to conversation

kernel/irq/handle.c fix kstat_irqs_cpu and irq_to_desc symbols

PATCH In review Mathieu Desnoyers 3 participants 5 messages Mar 16, 2009 – Mar 17, 2009 7 messages not in the archive IRQ

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 20090316194459.GD11878@Krystal

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 20090316202500.GA13872@Krystal

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 20090316215337.GB15119@Krystal

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw

PATCH 1/1 kernel/irq/handle.c fix kstat_irqs_cpu and irq_to_desc symbols

Quoted 43 lines · Mathieu Desnoyers
Quoted 42 lines · * Josh Boyer ([email protected]) wrote:
Quoted 40 lines · Mathieu Desnoyers
Quoted 30 lines · * Josh Boyer ([email protected]) wrote:
Quoted 9 lines · Mathieu Desnoyers
Quoted 8 lines · * Josh Boyer ([email protected]) wrote:

Hi All,

I was attempting to build a simple ppc64_defconfig using the latest LTTng tag from git. When doing a:

make ppc64_defconfig
make

Quoted 8 lines
Quoted 2 lines

I get the error below.

Hi Josh,

Yes, LTTng has been tested with slub, but not for the powerpc64 cross-build. Thanks for the report, this is actually a header circular dependency I caused. It should be fixed in LTTng 0.111.

Bah. Yes, I should have clarified on ppc/ppc64. Sorry for the confusion there.

Quoted 3 lines

I'll have to update my powerpc64 cross compiler to test it, because I am stucked with a broken gcc 4.1. Please tell me if 0.111 fixes the problem for you or if you encounter other problems.

Yep, the extern on tb_ticks_per_sec is what I had come up with locally. It should work fine, and does indeed get past the error I was seeing. The build now dies with:

Quoted 7 lines

kernel/irq/handle.c:259: error: __ksymtab_irq_to_desc causes a section type conflict kernel/irq/handle.c:259: error: __ksymtab_irq_to_desc causes a section type conflict make[2]: *** [kernel/irq/handle.o] Error 1
make[1]: *** [kernel/irq] Error 2
make: *** [kernel] Error 2
make: *** Waiting for unfinished jobs....

Can I get your full .config ?

Quoted 8 lines
Quoted 6 lines

Sure, attached. Note, this is just:

make ppc64_defconfig
make vmlinux

josh

Can you try moving this code around ?

Yep, allows vmlinux and modules to build just fine. Here's a patch for you ;)

Mathieu :

This build problem was exhibited because of the added EXPORT_SYMBOL(irq_to_desc) in the LTTng tree, but only on powerpc.

Applies on 2.6.29-rc8.

From: Josh Boyer <[email protected]>

---
 include/linux/irqnr.h |    4 ++++
 kernel/irq/handle.c   |    2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
include/linux/irqnr.h +4 -0
Index: linux-2.6-lttng/include/linux/irqnr.h
===================================================================
@@ -38,6 +38,10 @@ extern struct irq_desc *irq_to_desc(unsi
 
 #endif /* CONFIG_GENERIC_HARDIRQS */
 
+extern int nr_irqs;
+struct irq_desc;
+extern struct irq_desc *irq_to_desc(unsigned int irq);
+
 #define for_each_irq_nr(irq)                   \
        for (irq = 0; irq < nr_irqs; irq++)
 
kernel/irq/handle.c +1 -1
Index: linux-2.6-lttng/kernel/irq/handle.c
===================================================================
@@ -473,6 +473,6 @@ unsigned int kstat_irqs_cpu(unsigned int
 	struct irq_desc *desc = irq_to_desc(irq);
 	return desc ? desc->kstat_irqs[cpu] : 0;
 }
-#endif
 EXPORT_SYMBOL(kstat_irqs_cpu);
+#endif
 
Signature · 2 lines
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#8 lore raw
Quoted 6 lines · Mathieu Desnoyers

Mathieu :

This build problem was exhibited because of the added EXPORT_SYMBOL(irq_to_desc) in the LTTng tree, but only on powerpc.

Applies on 2.6.29-rc8.

Applies, but that does not make it a useful patch per se.

2.6.29-rc8/include/linux/irqnr.h has (condensed excerpt):

#ifndef CONFIG_GENERIC_HARDIRQS
#define nr_irqs NR_IRQS
#define irq_to_desc(irq) (&irq_desc[irq])
#else
extern int nr_irqs;
extern struct irq_desc *irq_to_desc(unsigned int irq); #endif /* CONFIG_GENERIC_HARDIRQS */

And this adds right below of the #endif:

include/linux/irqnr.h extern struct irq_desc *irq_to_desc(unsi · line 44

Quoted 9 lines

+++ linux-2.6-lttng/include/linux/irqnr.h 2009-03-16 18:40:01.000000000 -0400

include/linux/irqnr.h +4 -0
@@ -38,6 +38,10 @@ extern struct irq_desc *irq_to_desc(unsi
 
 #endif /* CONFIG_GENERIC_HARDIRQS */
 
+extern int nr_irqs;
+struct irq_desc;
+extern struct irq_desc *irq_to_desc(unsigned int irq);
+

Is this a contribution to the "most useless patch of the week" contest ?

You have my vote.

tglx

#9 lore raw

Re: [PATCH] kernel/irq/handle.c fix kstat_irqs_cpu and irq_to_desc symbols v2

Quoted 5 lines · * Thomas Gleixner ([email protected]) wrote:

Is this a contribution to the "most useless patch of the week" contest ?

You have my vote.

Count mine too ! :) Actually, this was not what it should look like. Here is my version. I am not totally convinced that the struct irq_desc is absolutely required, but in some include orders, it might matter. However, the #endif around the EXPORT_SYMBOL is definitely needed.

Best regards,

Mathieu

kernel/irq/handle.c fix kstat_irqs_cpu and irq_to_desc symbols v2

Quoted 43 lines · Mathieu Desnoyers
Quoted 42 lines · * Josh Boyer ([email protected]) wrote:
Quoted 40 lines · Mathieu Desnoyers
Quoted 30 lines · * Josh Boyer ([email protected]) wrote:
Quoted 9 lines · Mathieu Desnoyers
Quoted 8 lines · * Josh Boyer ([email protected]) wrote:

Hi All,

I was attempting to build a simple ppc64_defconfig using the latest LTTng tag from git. When doing a:

make ppc64_defconfig
make

Quoted 8 lines
Quoted 2 lines

I get the error below.

Hi Josh,

Yes, LTTng has been tested with slub, but not for the powerpc64 cross-build. Thanks for the report, this is actually a header circular dependency I caused. It should be fixed in LTTng 0.111.

Bah. Yes, I should have clarified on ppc/ppc64. Sorry for the confusion there.

Quoted 3 lines

I'll have to update my powerpc64 cross compiler to test it, because I am stucked with a broken gcc 4.1. Please tell me if 0.111 fixes the problem for you or if you encounter other problems.

Yep, the extern on tb_ticks_per_sec is what I had come up with locally. It should work fine, and does indeed get past the error I was seeing. The build now dies with:

Quoted 7 lines

kernel/irq/handle.c:259: error: __ksymtab_irq_to_desc causes a section type conflict kernel/irq/handle.c:259: error: __ksymtab_irq_to_desc causes a section type conflict make[2]: *** [kernel/irq/handle.o] Error 1
make[1]: *** [kernel/irq] Error 2
make: *** [kernel] Error 2
make: *** Waiting for unfinished jobs....

Can I get your full .config ?

Quoted 8 lines
Quoted 6 lines

Sure, attached. Note, this is just:

make ppc64_defconfig
make vmlinux

josh

Can you try moving this code around ?

Yep, allows vmlinux and modules to build just fine. Here's a patch for you ;)

Based on a patch from Josh Boyer <[email protected]>, updated by Mathieu Desnoyers.

---
 include/linux/irqnr.h |    1 +
 kernel/irq/handle.c   |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
include/linux/irqnr.h +1 -0
Index: linux-2.6-lttng/include/linux/irqnr.h
===================================================================
@@ -23,6 +23,7 @@
 #else /* CONFIG_GENERIC_HARDIRQS */
 
 extern int nr_irqs;
+struct irq_desc;
 extern struct irq_desc *irq_to_desc(unsigned int irq);
 
 # define for_each_irq_desc(irq, desc)					\
kernel/irq/handle.c +1 -1
Index: linux-2.6-lttng/kernel/irq/handle.c
===================================================================
@@ -473,6 +473,6 @@ unsigned int kstat_irqs_cpu(unsigned int
 	struct irq_desc *desc = irq_to_desc(irq);
 	return desc ? desc->kstat_irqs[cpu] : 0;
 }
-#endif
 EXPORT_SYMBOL(kstat_irqs_cpu);
+#endif
 
Signature · 2 lines
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#10 lore raw

Re: [PATCH] kernel/irq/handle.c fix kstat_irqs_cpu and irq_to_desc symbols v2

Quoted 67 lines · Mathieu Desnoyers
Quoted 5 lines · * Thomas Gleixner ([email protected]) wrote:

Is this a contribution to the "most useless patch of the week" contest ?

You have my vote.

Count mine too ! :) Actually, this was not what it should look like. Here is my version. I am not totally convinced that the struct irq_desc is absolutely required, but in some include orders, it might matter. However, the #endif around the EXPORT_SYMBOL is definitely needed.

Best regards,

Mathieu

kernel/irq/handle.c fix kstat_irqs_cpu and irq_to_desc symbols v2

Quoted 48 lines · Mathieu Desnoyers
Quoted 47 lines · * Josh Boyer ([email protected]) wrote:
Quoted 39 lines · Mathieu Desnoyers
Quoted 30 lines · * Josh Boyer ([email protected]) wrote:
Quoted 9 lines · Mathieu Desnoyers
Quoted 8 lines · * Josh Boyer ([email protected]) wrote:

Hi All,

I was attempting to build a simple ppc64_defconfig using the latest LTTng tag from git. When doing a:

make ppc64_defconfig
make

Quoted 8 lines
Quoted 2 lines

I get the error below.

Hi Josh,

Yes, LTTng has been tested with slub, but not for the powerpc64 cross-build. Thanks for the report, this is actually a header circular dependency I caused. It should be fixed in LTTng 0.111.

Bah. Yes, I should have clarified on ppc/ppc64. Sorry for the confusion there.

Quoted 3 lines

I'll have to update my powerpc64 cross compiler to test it, because I am stucked with a broken gcc 4.1. Please tell me if 0.111 fixes the problem for you or if you encounter other problems.

Yep, the extern on tb_ticks_per_sec is what I had come up with locally. It should work fine, and does indeed get past the error I was seeing. The build now dies with:

Quoted 7 lines

kernel/irq/handle.c:259: error: __ksymtab_irq_to_desc causes a section type conflict kernel/irq/handle.c:259: error: __ksymtab_irq_to_desc causes a section type conflict make[2]: *** [kernel/irq/handle.o] Error 1
make[1]: *** [kernel/irq] Error 2
make: *** [kernel] Error 2
make: *** Waiting for unfinished jobs....

Quoted 1 line

Can I get your full .config ?

Sure, attached. Note, this is just:

make ppc64_defconfig
make vmlinux

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

josh

Can you try moving this code around ?

Yep, allows vmlinux and modules to build just fine. Here's a patch for you ;)

Based on a patch from Josh Boyer <[email protected]>, updated by Mathieu Desnoyers.

You don't need to credit me here. All I did was take your "Can you try moving this code around" sequence and actually turn it into patch format.

I do agree the #endif move is needed in the builds I was trying though.

josh

Quoted 34 lines

---

include/linux/irqnr.h |    1 +
kernel/irq/handle.c   |    2 +-
2 files changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6-lttng/include/linux/irqnr.h
===================================================================

include/linux/irqnr.h +1 -0
@@ -23,6 +23,7 @@
 #else /* CONFIG_GENERIC_HARDIRQS */
 
 extern int nr_irqs;
+struct irq_desc;
 extern struct irq_desc *irq_to_desc(unsigned int irq);
 
 # define for_each_irq_desc(irq, desc)					\

Index: linux-2.6-lttng/kernel/irq/handle.c
===================================================================

kernel/irq/handle.c +1 -1
@@ -473,6 +473,6 @@ unsigned int kstat_irqs_cpu(unsigned int
 	struct irq_desc *desc = irq_to_desc(irq);
 	return desc ? desc->kstat_irqs[cpu] : 0;
 }
-#endif
 EXPORT_SYMBOL(kstat_irqs_cpu);
+#endif
 
Signature · 3 lines
-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
#11 lore raw

Re: [PATCH] kernel/irq/handle.c fix kstat_irqs_cpu and irq_to_desc symbols v2

In reply to Mathieu Desnoyers
Quoted 10 lines · Mathieu Desnoyers
Quoted 5 lines · * Thomas Gleixner ([email protected]) wrote:

Is this a contribution to the "most useless patch of the week" contest ?

You have my vote.

Count mine too ! :) Actually, this was not what it should look like. Here is my version. I am not totally convinced that the struct irq_desc is absolutely required, but in some include orders, it might matter.

I have not seen a compile failure report yet.

Quoted 1 line

However, the #endif around the EXPORT_SYMBOL is definitely needed.

Right.

kernel/irq/handle.c unsigned int kstat_irqs_cpu(unsigned int · line 477

Quoted 6 lines
kernel/irq/handle.c +1 -1
 	struct irq_desc *desc = irq_to_desc(irq);
 	return desc ? desc->kstat_irqs[cpu] : 0;
 }
-#endif
 EXPORT_SYMBOL(kstat_irqs_cpu);
+#endif

Thanks,

tglx