All of lore.kernel.org
 help / color / mirror / Atom feed
* [ARM] Fix hard_smp_processor_id compile error
@ 2007-05-15  2:18 Simon Horman
  2007-05-15  2:59 ` Fernando Luis Vázquez Cao
  2007-05-15  8:19 ` Russell King
  0 siblings, 2 replies; 9+ messages in thread
From: Simon Horman @ 2007-05-15  2:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: Fernando Luis Vazquez Cao, Andrew Morton, Russell King

"Remove hardcoding of hard_smp_processor_id on UP systems",
2f4dfe206a2fc07099dfad77a8ea2f4b4ae2140f in Linus' tree, moved
the definition of hard_smp_processor_id linux/smp.h to asm/smp.h
for UP systems. This causes a regression on ARM as the definition
was not added to asm-arm/smp.h.

Cc: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>

--- 
 arch/arm/mach-integrator/core.c |    1 +
 include/asm-arm/smp.h           |   10 ++++++----
 2 files changed, 7 insertions(+), 4 deletions(-)

arm-unknown-linux-gnu-gcc (GCC) 4.1.1
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  CC      arch/arm/mach-integrator/core.o
arch/arm/mach-integrator/core.c: In function 'integrator_timer_interrupt':
arch/arm/mach-integrator/core.c:264: warning: implicit declaration of function 'hard_smp_processor_id'
[snip]
  LD      .tmp_vmlinux1
arch/arm/mach-integrator/built-in.o: In function `integrator_timer_interrupt':
cpu.c:(.text+0x398): undefined reference to `hard_smp_processor_id'
make: *** [.tmp_vmlinux1] error 1

This was produced by running the following in a crosstool cross-compiling
environment:
 cp arch/arm/configs/integrator_defconfig .config
 yes "" | make modconfig
 make

Index: linux-2.6/arch/arm/mach-integrator/core.c
===================================================================
--- linux-2.6.orig/arch/arm/mach-integrator/core.c	2007-05-15 10:56:06.000000000 +0900
+++ linux-2.6/arch/arm/mach-integrator/core.c	2007-05-15 10:56:16.000000000 +0900
@@ -28,6 +28,7 @@
 #include <asm/system.h>
 #include <asm/leds.h>
 #include <asm/mach/time.h>
+#include <asm/smp.h>
 
 #include "common.h"
 
Index: linux-2.6/include/asm-arm/smp.h
===================================================================
--- linux-2.6.orig/include/asm-arm/smp.h	2007-05-15 10:51:54.000000000 +0900
+++ linux-2.6/include/asm-arm/smp.h	2007-05-15 10:56:34.000000000 +0900
@@ -10,16 +10,16 @@
 #ifndef __ASM_ARM_SMP_H
 #define __ASM_ARM_SMP_H
 
+#ifndef CONFIG_SMP
+#define hard_smp_processor_id()		0
+#else
+
 #include <linux/threads.h>
 #include <linux/cpumask.h>
 #include <linux/thread_info.h>
 
 #include <asm/arch/smp.h>
 
-#ifndef CONFIG_SMP
-# error "<asm-arm/smp.h> included in non-SMP build"
-#endif
-
 #define raw_smp_processor_id() (current_thread_info()->cpu)
 
 /*
@@ -134,4 +134,6 @@ extern void show_local_irqs(struct seq_f
  */
 asmlinkage void do_local_timer(struct pt_regs *);
 
+#endif /* CONFIG_SMP */
+
 #endif /* ifndef __ASM_ARM_SMP_H */

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

* Re: [ARM] Fix hard_smp_processor_id compile error
  2007-05-15  2:18 [ARM] Fix hard_smp_processor_id compile error Simon Horman
@ 2007-05-15  2:59 ` Fernando Luis Vázquez Cao
  2007-05-15  4:48   ` Andrew Morton
  2007-05-15  8:19 ` Russell King
  1 sibling, 1 reply; 9+ messages in thread
From: Fernando Luis Vázquez Cao @ 2007-05-15  2:59 UTC (permalink / raw)
  To: Simon Horman; +Cc: linux-kernel, Andrew Morton, Russell King

On Tue, 2007-05-15 at 11:18 +0900, Simon Horman wrote: 
> "Remove hardcoding of hard_smp_processor_id on UP systems",
> 2f4dfe206a2fc07099dfad77a8ea2f4b4ae2140f in Linus' tree, moved
> the definition of hard_smp_processor_id linux/smp.h to asm/smp.h
> for UP systems. This causes a regression on ARM as the definition
> was not added to asm-arm/smp.h.
Hi Simon!

Thank you for catching and fixing these compile errors. I should install
a cross-compiler ASAP.

- Fernando

> Cc: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
> Signed-off-by: Simon Horman <horms@verge.net.au>
> 
> --- 
>  arch/arm/mach-integrator/core.c |    1 +
>  include/asm-arm/smp.h           |   10 ++++++----
>  2 files changed, 7 insertions(+), 4 deletions(-)
> 
> arm-unknown-linux-gnu-gcc (GCC) 4.1.1
> Copyright (C) 2006 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
>   CC      arch/arm/mach-integrator/core.o
> arch/arm/mach-integrator/core.c: In function 'integrator_timer_interrupt':
> arch/arm/mach-integrator/core.c:264: warning: implicit declaration of function 'hard_smp_processor_id'
> [snip]
>   LD      .tmp_vmlinux1
> arch/arm/mach-integrator/built-in.o: In function `integrator_timer_interrupt':
> cpu.c:(.text+0x398): undefined reference to `hard_smp_processor_id'
> make: *** [.tmp_vmlinux1] error 1
> 
> This was produced by running the following in a crosstool cross-compiling
> environment:
>  cp arch/arm/configs/integrator_defconfig .config
>  yes "" | make modconfig
>  make
> 
> Index: linux-2.6/arch/arm/mach-integrator/core.c
> ===================================================================
> --- linux-2.6.orig/arch/arm/mach-integrator/core.c	2007-05-15 10:56:06.000000000 +0900
> +++ linux-2.6/arch/arm/mach-integrator/core.c	2007-05-15 10:56:16.000000000 +0900
> @@ -28,6 +28,7 @@
>  #include <asm/system.h>
>  #include <asm/leds.h>
>  #include <asm/mach/time.h>
> +#include <asm/smp.h>
>  
>  #include "common.h"
>  
> Index: linux-2.6/include/asm-arm/smp.h
> ===================================================================
> --- linux-2.6.orig/include/asm-arm/smp.h	2007-05-15 10:51:54.000000000 +0900
> +++ linux-2.6/include/asm-arm/smp.h	2007-05-15 10:56:34.000000000 +0900
> @@ -10,16 +10,16 @@
>  #ifndef __ASM_ARM_SMP_H
>  #define __ASM_ARM_SMP_H
>  
> +#ifndef CONFIG_SMP
> +#define hard_smp_processor_id()		0
> +#else
> +
>  #include <linux/threads.h>
>  #include <linux/cpumask.h>
>  #include <linux/thread_info.h>
>  
>  #include <asm/arch/smp.h>
>  
> -#ifndef CONFIG_SMP
> -# error "<asm-arm/smp.h> included in non-SMP build"
> -#endif
> -
>  #define raw_smp_processor_id() (current_thread_info()->cpu)
>  
>  /*
> @@ -134,4 +134,6 @@ extern void show_local_irqs(struct seq_f
>   */
>  asmlinkage void do_local_timer(struct pt_regs *);
>  
> +#endif /* CONFIG_SMP */
> +
>  #endif /* ifndef __ASM_ARM_SMP_H */


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

* Re: [ARM] Fix hard_smp_processor_id compile error
  2007-05-15  2:59 ` Fernando Luis Vázquez Cao
@ 2007-05-15  4:48   ` Andrew Morton
  2007-05-15  4:54     ` Simon Horman
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Morton @ 2007-05-15  4:48 UTC (permalink / raw)
  To: Fernando Luis Vázquez Cao; +Cc: Simon Horman, linux-kernel, Russell King

On Tue, 15 May 2007 11:59:41 +0900 Fernando Luis Vázquez Cao <fernando@oss.ntt.co.jp> wrote:

> On Tue, 2007-05-15 at 11:18 +0900, Simon Horman wrote: 
> > "Remove hardcoding of hard_smp_processor_id on UP systems",
> > 2f4dfe206a2fc07099dfad77a8ea2f4b4ae2140f in Linus' tree, moved
> > the definition of hard_smp_processor_id linux/smp.h to asm/smp.h
> > for UP systems. This causes a regression on ARM as the definition
> > was not added to asm-arm/smp.h.
> Hi Simon!
> 
> Thank you for catching and fixing these compile errors. I should install
> a cross-compiler ASAP.

Mine are at http://userweb.kernel.org/~akpm/cross-compilers/

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

* Re: [ARM] Fix hard_smp_processor_id compile error
  2007-05-15  4:48   ` Andrew Morton
@ 2007-05-15  4:54     ` Simon Horman
  2007-05-15  5:22       ` Andrew Morton
  0 siblings, 1 reply; 9+ messages in thread
From: Simon Horman @ 2007-05-15  4:54 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Fernando Luis Vázquez Cao, linux-kernel, Russell King

On Mon, May 14, 2007 at 09:48:18PM -0700, Andrew Morton wrote:
> On Tue, 15 May 2007 11:59:41 +0900 Fernando Luis Vázquez Cao <fernando@oss.ntt.co.jp> wrote:
> 
> > On Tue, 2007-05-15 at 11:18 +0900, Simon Horman wrote: 
> > > "Remove hardcoding of hard_smp_processor_id on UP systems",
> > > 2f4dfe206a2fc07099dfad77a8ea2f4b4ae2140f in Linus' tree, moved
> > > the definition of hard_smp_processor_id linux/smp.h to asm/smp.h
> > > for UP systems. This causes a regression on ARM as the definition
> > > was not added to asm-arm/smp.h.
> > Hi Simon!
> > 
> > Thank you for catching and fixing these compile errors. I should install
> > a cross-compiler ASAP.
> 
> Mine are at http://userweb.kernel.org/~akpm/cross-compilers/

Do you have / know of tools to create a set of configs for testing?
What I am thinking of is something that takes the default configs,
then toggles SMP, PREEMT and stuff like that, testing all the
permutations.

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/


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

* Re: [ARM] Fix hard_smp_processor_id compile error
  2007-05-15  4:54     ` Simon Horman
@ 2007-05-15  5:22       ` Andrew Morton
  2007-05-15  5:28         ` Simon Horman
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Morton @ 2007-05-15  5:22 UTC (permalink / raw)
  To: Simon Horman; +Cc: Fernando Luis Vázquez Cao, linux-kernel, Russell King

On Tue, 15 May 2007 13:54:23 +0900 Simon Horman <horms@verge.net.au> wrote:

> On Mon, May 14, 2007 at 09:48:18PM -0700, Andrew Morton wrote:
> > On Tue, 15 May 2007 11:59:41 +0900 Fernando Luis Vázquez Cao <fernando@oss.ntt.co.jp> wrote:
> > 
> > > On Tue, 2007-05-15 at 11:18 +0900, Simon Horman wrote: 
> > > > "Remove hardcoding of hard_smp_processor_id on UP systems",
> > > > 2f4dfe206a2fc07099dfad77a8ea2f4b4ae2140f in Linus' tree, moved
> > > > the definition of hard_smp_processor_id linux/smp.h to asm/smp.h
> > > > for UP systems. This causes a regression on ARM as the definition
> > > > was not added to asm-arm/smp.h.
> > > Hi Simon!
> > > 
> > > Thank you for catching and fixing these compile errors. I should install
> > > a cross-compiler ASAP.
> > 
> > Mine are at http://userweb.kernel.org/~akpm/cross-compilers/
> 
> Do you have / know of tools to create a set of configs for testing?
> What I am thinking of is something that takes the default configs,
> then toggles SMP, PREEMT and stuff like that, testing all the
> permutations.

`make randconfig'?

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

* Re: [ARM] Fix hard_smp_processor_id compile error
  2007-05-15  5:22       ` Andrew Morton
@ 2007-05-15  5:28         ` Simon Horman
  0 siblings, 0 replies; 9+ messages in thread
From: Simon Horman @ 2007-05-15  5:28 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Fernando Luis Vázquez Cao, linux-kernel, Russell King

On Mon, May 14, 2007 at 10:22:34PM -0700, Andrew Morton wrote:
> On Tue, 15 May 2007 13:54:23 +0900 Simon Horman <horms@verge.net.au> wrote:
> 
> > On Mon, May 14, 2007 at 09:48:18PM -0700, Andrew Morton wrote:
> > > On Tue, 15 May 2007 11:59:41 +0900 Fernando Luis Vázquez Cao <fernando@oss.ntt.co.jp> wrote:
> > > 
> > > > On Tue, 2007-05-15 at 11:18 +0900, Simon Horman wrote: 
> > > > > "Remove hardcoding of hard_smp_processor_id on UP systems",
> > > > > 2f4dfe206a2fc07099dfad77a8ea2f4b4ae2140f in Linus' tree, moved
> > > > > the definition of hard_smp_processor_id linux/smp.h to asm/smp.h
> > > > > for UP systems. This causes a regression on ARM as the definition
> > > > > was not added to asm-arm/smp.h.
> > > > Hi Simon!
> > > > 
> > > > Thank you for catching and fixing these compile errors. I should install
> > > > a cross-compiler ASAP.
> > > 
> > > Mine are at http://userweb.kernel.org/~akpm/cross-compilers/
> > 
> > Do you have / know of tools to create a set of configs for testing?
> > What I am thinking of is something that takes the default configs,
> > then toggles SMP, PREEMT and stuff like that, testing all the
> > permutations.
> 
> `make randconfig'?

I was thinking of something a little more predictable.
But that end up could working just as well.

-- 
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/


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

* Re: [ARM] Fix hard_smp_processor_id compile error
  2007-05-15  2:18 [ARM] Fix hard_smp_processor_id compile error Simon Horman
  2007-05-15  2:59 ` Fernando Luis Vázquez Cao
@ 2007-05-15  8:19 ` Russell King
  2007-05-15  9:09   ` Simon Horman
  1 sibling, 1 reply; 9+ messages in thread
From: Russell King @ 2007-05-15  8:19 UTC (permalink / raw)
  To: Simon Horman; +Cc: linux-kernel, Fernando Luis Vazquez Cao, Andrew Morton

On Tue, May 15, 2007 at 11:18:50AM +0900, Simon Horman wrote:
> "Remove hardcoding of hard_smp_processor_id on UP systems",
> 2f4dfe206a2fc07099dfad77a8ea2f4b4ae2140f in Linus' tree, moved
> the definition of hard_smp_processor_id linux/smp.h to asm/smp.h
> for UP systems. This causes a regression on ARM as the definition
> was not added to asm-arm/smp.h.
> 
> Cc: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
> Signed-off-by: Simon Horman <horms@verge.net.au>

I took an alternative approach - since Integrator never had the complete
SMP support merged, I ripped it out of that platform.  Whether realview
suffers from the same thing or not I'm not sure - uniprocessor realview
is not something covered by the ARM default configuration files, and
therefore kautobuild won't check that configuration.

However, the things I find annoying about this is:

1. asm/smp.h was _never_ included in ARM UP builds prior to this change.
2. we have linux/smp.h and the general rule is that if asm/foo.h and
   linux/foo.h are present, linux/foo.h is included in preference to
   asm/foo.h

Given the amount of janitors we now have looking at the kernel code,
(2) is a big concern - it could mean a constant stream of patches
trying to "fix" files including asm/smp.h.

I would suggest that if there is a desire to include asm/smp.h on UP
builds, the inclusion of it by linux/smp.h is made unconditional.

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

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

* Re: [ARM] Fix hard_smp_processor_id compile error
  2007-05-15  8:19 ` Russell King
@ 2007-05-15  9:09   ` Simon Horman
  2007-05-15  9:49     ` Simon Horman
  0 siblings, 1 reply; 9+ messages in thread
From: Simon Horman @ 2007-05-15  9:09 UTC (permalink / raw)
  To: linux-kernel, Fernando Luis Vazquez Cao, Andrew Morton

On Tue, May 15, 2007 at 09:19:07AM +0100, Russell King wrote:
> On Tue, May 15, 2007 at 11:18:50AM +0900, Simon Horman wrote:
> > "Remove hardcoding of hard_smp_processor_id on UP systems",
> > 2f4dfe206a2fc07099dfad77a8ea2f4b4ae2140f in Linus' tree, moved
> > the definition of hard_smp_processor_id linux/smp.h to asm/smp.h
> > for UP systems. This causes a regression on ARM as the definition
> > was not added to asm-arm/smp.h.
> > 
> > Cc: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
> > Signed-off-by: Simon Horman <horms@verge.net.au>
> 
> I took an alternative approach - since Integrator never had the complete
> SMP support merged, I ripped it out of that platform.  Whether realview
> suffers from the same thing or not I'm not sure - uniprocessor realview
> is not something covered by the ARM default configuration files, and
> therefore kautobuild won't check that configuration.

I can take a look into this. Is there a tree other than Linus'
I should be working with?

> However, the things I find annoying about this is:
> 
> 1. asm/smp.h was _never_ included in ARM UP builds prior to this change.
> 2. we have linux/smp.h and the general rule is that if asm/foo.h and
>    linux/foo.h are present, linux/foo.h is included in preference to
>    asm/foo.h
> 
> Given the amount of janitors we now have looking at the kernel code,
> (2) is a big concern - it could mean a constant stream of patches
> trying to "fix" files including asm/smp.h.
> 
> I would suggest that if there is a desire to include asm/smp.h on UP
> builds, the inclusion of it by linux/smp.h is made unconditional.

I was thinking that myself, though I'm kind of fearful of
what kind of (additional) breakage it might cause.


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

* Re: [ARM] Fix hard_smp_processor_id compile error
  2007-05-15  9:09   ` Simon Horman
@ 2007-05-15  9:49     ` Simon Horman
  0 siblings, 0 replies; 9+ messages in thread
From: Simon Horman @ 2007-05-15  9:49 UTC (permalink / raw)
  To: linux-kernel, Fernando Luis Vazquez Cao, Andrew Morton

On Tue, May 15, 2007 at 06:09:18PM +0900, Simon Horman wrote:
> On Tue, May 15, 2007 at 09:19:07AM +0100, Russell King wrote:
> > On Tue, May 15, 2007 at 11:18:50AM +0900, Simon Horman wrote:
> > > "Remove hardcoding of hard_smp_processor_id on UP systems",
> > > 2f4dfe206a2fc07099dfad77a8ea2f4b4ae2140f in Linus' tree, moved
> > > the definition of hard_smp_processor_id linux/smp.h to asm/smp.h
> > > for UP systems. This causes a regression on ARM as the definition
> > > was not added to asm-arm/smp.h.
> > > 
> > > Cc: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
> > > Signed-off-by: Simon Horman <horms@verge.net.au>
> > 
> > I took an alternative approach - since Integrator never had the complete
> > SMP support merged, I ripped it out of that platform.  Whether realview
> > suffers from the same thing or not I'm not sure - uniprocessor realview
> > is not something covered by the ARM default configuration files, and
> > therefore kautobuild won't check that configuration.
> 
> I can take a look into this. Is there a tree other than Linus'
> I should be working with?

Looking at Linus' it seems that for realview UP builds based on
realview_defconfig don't suffer hard_smp_processor_id breakage.

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

end of thread, other threads:[~2007-05-15  9:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-15  2:18 [ARM] Fix hard_smp_processor_id compile error Simon Horman
2007-05-15  2:59 ` Fernando Luis Vázquez Cao
2007-05-15  4:48   ` Andrew Morton
2007-05-15  4:54     ` Simon Horman
2007-05-15  5:22       ` Andrew Morton
2007-05-15  5:28         ` Simon Horman
2007-05-15  8:19 ` Russell King
2007-05-15  9:09   ` Simon Horman
2007-05-15  9:49     ` Simon Horman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.