Skip to contentSkip to conversation

sparc: don't #include asm/system.h in asm/jump_label.h

PATCH In review Namhyung Kim 4 participants 14 messages Oct 25, 2010 – Oct 26, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 sparc: don't #include asm/system.h in asm/jump_label.h

It seems that #include <asm/system.h> makes a circular dependency between kernel.h and bitmap.h which breaks allmodconfig build. Removing the line makes no change because jump_label.h doesn't need it actually AFAICS. Compile tested on sparc32 allmodconfig.

---

Failed build log is as following:

CC arch/sparc/kernel/asm-offsets.s
In file included from include/linux/cpumask.h:11:0,

                 from arch/sparc/include/asm/smp_32.h:15,
                 from arch/sparc/include/asm/smp.h:6,
                 from arch/sparc/include/asm/system_32.h:12,
                 from arch/sparc/include/asm/system.h:6,
                 from arch/sparc/include/asm/jump_label.h:7,
                 from include/linux/jump_label.h:5,
                 from include/linux/dynamic_debug.h:4,
                 from include/linux/kernel.h:20,
                 from include/linux/sched.h:54,
                 from arch/sparc/kernel/asm-offsets.c:13:
include/linux/bitmap.h: In function 'bitmap_zero':
include/linux/bitmap.h:159:3: error: implicit declaration of function 'DIV_ROUND_UP'
In file included from arch/sparc/include/asm/smp_32.h:15:0,
                 from arch/sparc/include/asm/smp.h:6,
                 from arch/sparc/include/asm/system_32.h:12,
                 from arch/sparc/include/asm/system.h:6,
                 from arch/sparc/include/asm/jump_label.h:7,
                 from include/linux/jump_label.h:5,
                 from include/linux/dynamic_debug.h:4,
                 from include/linux/kernel.h:20,
                 from include/linux/sched.h:54,
                 from arch/sparc/kernel/asm-offsets.c:13:

include/linux/cpumask.h: At top level:
include/linux/cpumask.h:13:26: error: variably modified 'bits' at file scope include/linux/cpumask.h:659:14: error: variably modified 'cpu_all_bits' at file scope include/linux/cpumask.h:705:2: error: variably modified 'cpu_bit_bitmap' at file scope make[3]: *** [arch/sparc/kernel/asm-offsets.s] Error 1
make[2]: *** [prepare0] Error 2
make[1]: *** [sub-make] Error 2
make: *** [all] Error 2

 arch/sparc/include/asm/jump_label.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
arch/sparc/include/asm/jump_label.h +0 -1
index 62e66d7..65c0d30 100644
@@ -4,7 +4,6 @@
 #ifdef __KERNEL__
 
 #include <linux/types.h>
-#include <asm/system.h>
 
 #define JUMP_LABEL_NOP_SIZE 4
 
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 2/3 sparc32: remove CONFIG_HAVE_PERF_EVENTS option

Remove HAVE_PERF_EVENTS and PERF_USE_VMALLOC under config SPARC because they're under SPARC64 too. Supporting perf_event needs atomic64 operations but AFAIK sparc32 doesn't provide them, CMIIW. ;-) Also removes redundant HAVE_IRQ_WORK line.

---
 arch/sparc/Kconfig |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
arch/sparc/Kconfig +0 -3
index 3e9d314..4db8bc0 100644
@@ -27,8 +27,6 @@ config SPARC
 	select RTC_CLASS
 	select RTC_DRV_M48T59
 	select HAVE_IRQ_WORK
-	select HAVE_PERF_EVENTS
-	select PERF_USE_VMALLOC
 	select HAVE_DMA_ATTRS
 	select HAVE_DMA_API_DEBUG
 	select HAVE_ARCH_JUMP_LABEL
@@ -55,7 +53,6 @@ config SPARC64
 	select RTC_DRV_BQ4802
 	select RTC_DRV_SUN4V
 	select RTC_DRV_STARFIRE
-	select HAVE_IRQ_WORK
 	select HAVE_PERF_EVENTS
 	select PERF_USE_VMALLOC
 
Signature · 1 line
1.7.0.4
maintainer
#2 lore raw

Re: [PATCH 2/3] sparc32: remove CONFIG_HAVE_PERF_EVENTS option

From: Namhyung Kim <[email protected]>
Date: Tue, 26 Oct 2010 00:52:37 +0900

Quoted 7 lines

Remove HAVE_PERF_EVENTS and PERF_USE_VMALLOC under config SPARC because they're under SPARC64 too. Supporting perf_event needs atomic64 operations but AFAIK sparc32 doesn't provide them, CMIIW. ;-) Also removes redundant HAVE_IRQ_WORK line.

The generic non-hw perf event stuff builds fine on sparc32, please don't remove this unless you have a legitimate build failure to report and fix.

Even if sparc32 doesn't provide atomic64_t support, it very easily could do so using include/asm-generic/atomic64.h which implements them using spinlocks.

#3 lore raw

Re: [PATCH 2/3] sparc32: remove CONFIG_HAVE_PERF_EVENTS option

2010-10-25 (ì›”), 08:59 -0700, David Miller:

Quoted 11 lines

From: Namhyung Kim <[email protected]>
Date: Tue, 26 Oct 2010 00:52:37 +0900

Quoted 7 lines

Remove HAVE_PERF_EVENTS and PERF_USE_VMALLOC under config SPARC because they're under SPARC64 too. Supporting perf_event needs atomic64 operations but AFAIK sparc32 doesn't provide them, CMIIW. ;-) Also removes redundant HAVE_IRQ_WORK line.

Quoted 7 lines

The generic non-hw perf event stuff builds fine on sparc32, please don't remove this unless you have a legitimate build failure to report and fix.

Even if sparc32 doesn't provide atomic64_t support, it very easily could do so using include/asm-generic/atomic64.h which implements them using spinlocks.

Now I see following build failure without this patch. Maybe some work is needed to deal with atomic64_t. I'll try to prepare for it soon. Thanks.

CC arch/sparc/kernel/setup_32.o
In file included from arch/sparc/include/asm/local64.h:1:0,

                 from include/linux/perf_event.h:465,
                 from include/linux/ftrace_event.h:8,
                 from include/trace/syscall.h:6,
                 from include/linux/syscalls.h:76,
                 from arch/sparc/kernel/setup_32.c:23:
include/asm-generic/local64.h:62:2: error: expected
                            specifier-qualifier-list before 'atomic64_t'
In file included from include/linux/ftrace_event.h:8:0,
                 from include/trace/syscall.h:6,
                 from include/linux/syscalls.h:76,
                 from arch/sparc/kernel/setup_32.c:23:

include/linux/perf_event.h:722:2: error: expected
specifier-qualifier-list before 'atomic64_t'
include/linux/perf_event.h: In function 'perf_fetch_caller_regs':
include/linux/perf_event.h:1004:2: error: 'struct pt_regs' has no member
named 'tstate'
include/linux/perf_event.h:1004:2: error: 'struct pt_regs' has no member
named 'tpc'
include/linux/perf_event.h:1004:2: error: 'struct pt_regs' has no member
named 'tnpc'
include/linux/perf_event.h:1004:2: error: 'struct pt_regs' has no member
named 'tpc'
make[3]: *** [arch/sparc/kernel/setup_32.o] Error 1
make[2]: *** [arch/sparc/kernel] Error 2
make[1]: *** [sub-make] Error 2
make: *** [all] Error 2

Signature · 2 lines
Regards,
Namhyung Kim
maintainer Acked-by
#4 lore raw

Re: [PATCH 2/3] sparc32: remove CONFIG_HAVE_PERF_EVENTS option

From: Namhyung Kim <[email protected]>
Date: Tue, 26 Oct 2010 01:31:19 +0900

Quoted 16 lines

2010-10-25 (월), 08:59 -0700, David Miller:

Quoted 15 lines

From: Namhyung Kim <[email protected]>
Date: Tue, 26 Oct 2010 00:52:37 +0900

Quoted 7 lines

Remove HAVE_PERF_EVENTS and PERF_USE_VMALLOC under config SPARC because they're under SPARC64 too. Supporting perf_event needs atomic64 operations but AFAIK sparc32 doesn't provide them, CMIIW. ;-) Also removes redundant HAVE_IRQ_WORK line.

The generic non-hw perf event stuff builds fine on sparc32, please don't remove this unless you have a legitimate build failure to report and fix.

Quoted 6 lines
Quoted 3 lines

Even if sparc32 doesn't provide atomic64_t support, it very easily could do so using include/asm-generic/atomic64.h which implements them using spinlocks.

Now I see following build failure without this patch. Maybe some work is needed to deal with atomic64_t. I'll try to prepare for it soon. Thanks.

Nevermind, I see the issue. Ok, your patch is fine:

#5 lore raw

PATCH 3/3 sparc32: fix build failure on CONFIG_SPARC_LEON

In reply to Namhyung Kim

CC arch/sparc/kernel/irq_32.o
arch/sparc/kernel/irq_32.c: In function 'request_fast_irq':
arch/sparc/kernel/irq_32.c:370:25: error: conflicting types for 'trapbase_cpu1' arch/sparc/include/asm/leon.h:366:22: note: previous declaration of 'trapbase_cpu1' was here arch/sparc/kernel/irq_32.c:370:40: error: conflicting types for 'trapbase_cpu2' arch/sparc/include/asm/leon.h:367:22: note: previous declaration of 'trapbase_cpu2' was here arch/sparc/kernel/irq_32.c:370:55: error: conflicting types for 'trapbase_cpu3' arch/sparc/include/asm/leon.h:368:22: note: previous declaration of 'trapbase_cpu3' was here make[3]: *** [arch/sparc/kernel/irq_32.o] Error 1
make[2]: *** [arch/sparc/kernel] Error 2
make[1]: *** [sub-make] Error 2
make: *** [all] Error 2

---
 arch/sparc/kernel/irq_32.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/sparc/kernel/irq_32.c +2 -2
index 0116d8d..5ad6e5c 100644
@@ -365,7 +365,7 @@ static int request_fast_irq(unsigned int irq,
 	unsigned long flags;
 	unsigned int cpu_irq;
 	int ret;
-#ifdef CONFIG_SMP
+#if defined CONFIG_SMP && !defined CONFIG_SPARC_LEON
 	struct tt_entry *trap_table;
 	extern struct tt_entry trapbase_cpu1, trapbase_cpu2, trapbase_cpu3;
 #endif
@@ -425,7 +425,7 @@ static int request_fast_irq(unsigned int irq,
 	table[SP_TRAP_IRQ1+(cpu_irq-1)].inst_four = SPARC_NOP;
 
 	INSTANTIATE(sparc_ttable)
-#ifdef CONFIG_SMP
+#if defined CONFIG_SMP && !defined CONFIG_SPARC_LEON
 	trap_table = &trapbase_cpu1; INSTANTIATE(trap_table)
 	trap_table = &trapbase_cpu2; INSTANTIATE(trap_table)
 	trap_table = &trapbase_cpu3; INSTANTIATE(trap_table)
Signature · 1 line
1.7.0.4
maintainer
#6 lore raw

Re: [PATCH 3/3] sparc32: fix build failure on CONFIG_SPARC_LEON

From: Namhyung Kim <[email protected]>
Date: Tue, 26 Oct 2010 00:52:38 +0900

Quoted 3 lines

CC arch/sparc/kernel/irq_32.o
arch/sparc/kernel/irq_32.c: In function 'request_fast_irq':
arch/sparc/kernel/irq_32.c:370:25: error: conflicting types for 'trapbase_cpu1'

I doubt SMP LEON chips even exist, so better to just anti-dep this in arch/sparc/Kconfig

#7 lore raw

Re: [PATCH 3/3] sparc32: fix build failure on CONFIG_SPARC_LEON

2010-10-25 (ì›”), 09:00 -0700, David Miller:

Quoted 9 lines

From: Namhyung Kim <[email protected]>
Date: Tue, 26 Oct 2010 00:52:38 +0900

Quoted 3 lines

CC arch/sparc/kernel/irq_32.o
arch/sparc/kernel/irq_32.c: In function 'request_fast_irq':
arch/sparc/kernel/irq_32.c:370:25: error: conflicting types for 'trapbase_cpu1'

I doubt SMP LEON chips even exist, so better to just anti-dep this in arch/sparc/Kconfig

If I understood correctly, you meant this?

arch/sparc/Kconfig +1 -1
index 4db8bc0..a6685ba 100644
@@ -463,7 +463,7 @@ config SERIAL_CONSOLE
 
 config SPARC_LEON
        bool "Sparc Leon processor family"
-       depends on SPARC32
+       depends on SPARC32 && !SMP
        ---help---
          If you say Y here if you are running on a SPARC-LEON

processor.
The LEON processor is a synthesizable VHDL model of the

Signature · 2 lines
Regards,
Namhyung Kim
maintainer
#8 lore raw

Re: [PATCH 3/3] sparc32: fix build failure on CONFIG_SPARC_LEON

From: Namhyung Kim <[email protected]>
Date: Tue, 26 Oct 2010 01:07:29 +0900

Quoted 4 lines

2010-10-25 (월), 09:00 -0700, David Miller:

Quoted 3 lines

From: Namhyung Kim <[email protected]>
Date: Tue, 26 Oct 2010 00:52:38 +0900

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

CC arch/sparc/kernel/irq_32.o
arch/sparc/kernel/irq_32.c: In function 'request_fast_irq':
arch/sparc/kernel/irq_32.c:370:25: error: conflicting types for 'trapbase_cpu1'

I doubt SMP LEON chips even exist, so better to just anti-dep this in arch/sparc/Kconfig

If I understood correctly, you meant this?

Yes, something like that.

#9 lore raw

Re: [PATCH 3/3] sparc32: fix build failure on CONFIG_SPARC_LEON

In reply to David Miller
Quoted 9 lines · David Miller

From: Namhyung Kim <[email protected]>
Date: Tue, 26 Oct 2010 00:52:38 +0900

Quoted 3 lines

CC arch/sparc/kernel/irq_32.o
arch/sparc/kernel/irq_32.c: In function 'request_fast_irq':
arch/sparc/kernel/irq_32.c:370:25: error: conflicting types for 'trapbase_cpu1'

I doubt SMP LEON chips even exist, so better to just anti-dep this in arch/sparc/Kconfig

I have a nice eval board at my desk with a dual-core LEON4 processor. I only lack time to play with it...

Sam

maintainer
#10 lore raw

Re: [PATCH 3/3] sparc32: fix build failure on CONFIG_SPARC_LEON

From: Sam Ravnborg <[email protected]>
Date: Mon, 25 Oct 2010 18:11:22 +0200

Quoted 8 lines · David Miller
Quoted 7 lines

From: Namhyung Kim <[email protected]>
Date: Tue, 26 Oct 2010 00:52:38 +0900

Quoted 3 lines

CC arch/sparc/kernel/irq_32.o
arch/sparc/kernel/irq_32.c: In function 'request_fast_irq':
arch/sparc/kernel/irq_32.c:370:25: error: conflicting types for 'trapbase_cpu1'

Quoted 5 lines
Quoted 2 lines

I doubt SMP LEON chips even exist, so better to just anti-dep this in arch/sparc/Kconfig

I have a nice eval board at my desk with a dual-core LEON4 processor. I only lack time to play with it...

Ok. But whenever someone gets a time to play with it and verify it works, we can sort out this build failure by modifying the code as needed.

But for now I prefer the Kconfig SMP dependency fix.

#11 lore raw

Re: [PATCH 3/3] sparc32: fix build failure on CONFIG_SPARC_LEON

Quoted 14 lines · David Miller

From: Sam Ravnborg <[email protected]>
Date: Mon, 25 Oct 2010 18:11:22 +0200

Quoted 11 lines · David Miller
Quoted 9 lines

From: Namhyung Kim <[email protected]>
Date: Tue, 26 Oct 2010 00:52:38 +0900

Quoted 3 lines

CC arch/sparc/kernel/irq_32.o
arch/sparc/kernel/irq_32.c: In function 'request_fast_irq':
arch/sparc/kernel/irq_32.c:370:25: error: conflicting types for 'trapbase_cpu1'

I doubt SMP LEON chips even exist, so better to just anti-dep this in arch/sparc/Kconfig

Quoted 8 lines
Quoted 2 lines

I have a nice eval board at my desk with a dual-core LEON4 processor. I only lack time to play with it...

Ok. But whenever someone gets a time to play with it and verify it works, we can sort out this build failure by modifying the code as needed.

But for now I prefer the Kconfig SMP dependency fix.

Yup - I agree.
My only intention was to tell that such a processor exists in reality and not only on paper.

Sam

#12 lore raw

Re: [PATCH 3/3] sparc32: fix build failure on CONFIG_SPARC_LEON

Quoted 33 lines · Sam Ravnborg
Quoted 30 lines · David Miller

From: Sam Ravnborg <[email protected]>
Date: Mon, 25 Oct 2010 18:11:22 +0200

Quoted 13 lines · David Miller
Quoted 12 lines

From: Namhyung Kim <[email protected]>
Date: Tue, 26 Oct 2010 00:52:38 +0900

Quoted 5 lines

CC arch/sparc/kernel/irq_32.o
arch/sparc/kernel/irq_32.c: In function 'request_fast_irq':
arch/sparc/kernel/irq_32.c:370:25: error: conflicting types for 'trapbase_cpu1'

Quoted 8 lines
Quoted 4 lines

I doubt SMP LEON chips even exist, so better to just anti-dep this in arch/sparc/Kconfig

I have a nice eval board at my desk with a dual-core LEON4 processor. I only lack time to play with it...

Ok. But whenever someone gets a time to play with it and verify it works, we can sort out this build failure by modifying the code as needed.

Quoted 8 lines
Quoted 3 lines

But for now I prefer the Kconfig SMP dependency fix.

Yup - I agree.
My only intention was to tell that such a processor exists in reality and not only on paper.

I stumbled into the same problem last weeks, enabling "Normal floppy disk support" (BLK_DEV_FD) on the LEON makes this error appear. There is no hardware for "Normal floppy disk support" on a LEON.

Regards,
Daniel Hellstrom

maintainer Acked-by on v1 1/3
#13 lore raw
In reply to Namhyung Kim

From: Namhyung Kim <[email protected]>
Date: Tue, 26 Oct 2010 00:52:36 +0900

Quoted 6 lines

It seems that #include <asm/system.h> makes a circular dependency between kernel.h and bitmap.h which breaks allmodconfig build. Removing the line makes no change because jump_label.h doesn't need it actually AFAICS. Compile tested on sparc32 allmodconfig.