Re: [PATCH 5/5] powerpc/setup_{32, 64}.c: remove unneeded boot_cpuid{, _phys}

2011-11-24 Thread Benjamin Herrenschmidt
On Tue, 2011-10-25 at 17:54 -0500, Matthew McClintock wrote:
 boot_cpuid and init_thread_info.cpu are redundant, just use the
 var that stays around longer and add a define to make boot_cpuid
 point at the correct value

Breaks pseries build. Looks trivial but I haven't had a chance to fix
it (obvious one liner didn't do it and no time today).

Please re-submit fixed.

Cheers,
Ben.

 boot_cpudid_phys is not needed and can completely go away from the
 SMP case, we leave it there for the non-SMP case since the paca
 struct is not around to store this info
 
 This patch also has the effect of having the logical cpu number
 of the boot cpu be updated correctly independently of the ordering
 of the cpu nodes in the device tree.
 
 Signed-off-by: Matthew McClintock m...@freescale.com
 ---
 Could also just change boot_cpuid every to init_thread_info.cpu instead
 of using this define
 
 This is only tested on 32-bit parts, only compiled on 64-bit
 
  arch/powerpc/include/asm/smp.h |2 +-
  arch/powerpc/kernel/setup_32.c |7 ---
  arch/powerpc/kernel/setup_64.c |1 -
  3 files changed, 5 insertions(+), 5 deletions(-)
 
 diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
 index adba970..f26c554 100644
 --- a/arch/powerpc/include/asm/smp.h
 +++ b/arch/powerpc/include/asm/smp.h
 @@ -29,7 +29,7 @@
  #endif
  #include asm/percpu.h
  
 -extern int boot_cpuid;
 +#define boot_cpuid   (init_thread_info.cpu)
  extern int spinning_secondaries;
  
  extern void cpu_die(void);
 diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
 index c1ce863..f396847 100644
 --- a/arch/powerpc/kernel/setup_32.c
 +++ b/arch/powerpc/kernel/setup_32.c
 @@ -46,10 +46,11 @@
  
  extern void bootx_init(unsigned long r4, unsigned long phys);
  
 -int boot_cpuid = -1;
 -EXPORT_SYMBOL_GPL(boot_cpuid);
 -int boot_cpuid_phys;
 +/* we need a place to store phys cpu for non-SMP case */
 +#ifndef CONFIG_SMP
 +int boot_cpuid_phys = -1;
  EXPORT_SYMBOL_GPL(boot_cpuid_phys);
 +#endif
  
  int smp_hw_index[NR_CPUS];
  
 diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
 index d4168c9..eacefba 100644
 --- a/arch/powerpc/kernel/setup_64.c
 +++ b/arch/powerpc/kernel/setup_64.c
 @@ -73,7 +73,6 @@
  #define DBG(fmt...)
  #endif
  
 -int boot_cpuid = 0;
  int __initdata spinning_secondaries;
  u64 ppc64_pft_size;
  


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 5/5] powerpc/setup_{32, 64}.c: remove unneeded boot_cpuid{, _phys}

2011-10-25 Thread Matthew McClintock
boot_cpuid and init_thread_info.cpu are redundant, just use the
var that stays around longer and add a define to make boot_cpuid
point at the correct value

boot_cpudid_phys is not needed and can completely go away from the
SMP case, we leave it there for the non-SMP case since the paca
struct is not around to store this info

This patch also has the effect of having the logical cpu number
of the boot cpu be updated correctly independently of the ordering
of the cpu nodes in the device tree.

Signed-off-by: Matthew McClintock m...@freescale.com
---
Could also just change boot_cpuid every to init_thread_info.cpu instead
of using this define

This is only tested on 32-bit parts, only compiled on 64-bit

 arch/powerpc/include/asm/smp.h |2 +-
 arch/powerpc/kernel/setup_32.c |7 ---
 arch/powerpc/kernel/setup_64.c |1 -
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index adba970..f26c554 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -29,7 +29,7 @@
 #endif
 #include asm/percpu.h
 
-extern int boot_cpuid;
+#define boot_cpuid (init_thread_info.cpu)
 extern int spinning_secondaries;
 
 extern void cpu_die(void);
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index c1ce863..f396847 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -46,10 +46,11 @@
 
 extern void bootx_init(unsigned long r4, unsigned long phys);
 
-int boot_cpuid = -1;
-EXPORT_SYMBOL_GPL(boot_cpuid);
-int boot_cpuid_phys;
+/* we need a place to store phys cpu for non-SMP case */
+#ifndef CONFIG_SMP
+int boot_cpuid_phys = -1;
 EXPORT_SYMBOL_GPL(boot_cpuid_phys);
+#endif
 
 int smp_hw_index[NR_CPUS];
 
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index d4168c9..eacefba 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -73,7 +73,6 @@
 #define DBG(fmt...)
 #endif
 
-int boot_cpuid = 0;
 int __initdata spinning_secondaries;
 u64 ppc64_pft_size;
 
-- 
1.7.6.1


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev