[kernel] r17251 - in dists/trunk/linux-2.6/debian: . patches/bugfix/powerpc
Ben Hutchings
benh at alioth.debian.org
Mon Apr 25 01:10:18 UTC 2011
Author: benh
Date: Mon Apr 25 01:10:06 2011
New Revision: 17251
Log:
[powerpc] kexec: Fix build failure on 32-bit SMP
Added:
dists/trunk/linux-2.6/debian/patches/bugfix/powerpc/powerpc-kexec-Fix-build-failure-on-32-bit-SMP.patch
Modified:
dists/trunk/linux-2.6/debian/changelog
Modified: dists/trunk/linux-2.6/debian/changelog
==============================================================================
--- dists/trunk/linux-2.6/debian/changelog Sun Apr 24 14:47:10 2011 (r17250)
+++ dists/trunk/linux-2.6/debian/changelog Mon Apr 25 01:10:06 2011 (r17251)
@@ -1,3 +1,10 @@
+linux-2.6 (2.6.39~rc4-1~experimental.2) UNRELEASED; urgency=low
+
+ [ Ben Hutchings ]
+ * [powerpc] kexec: Fix build failure on 32-bit SMP
+
+ -- Ben Hutchings <ben at decadent.org.uk> Mon, 25 Apr 2011 02:08:20 +0100
+
linux-2.6 (2.6.39~rc4-1~experimental.1) experimental; urgency=low
* New upstream release candidate
Added: dists/trunk/linux-2.6/debian/patches/bugfix/powerpc/powerpc-kexec-Fix-build-failure-on-32-bit-SMP.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/powerpc/powerpc-kexec-Fix-build-failure-on-32-bit-SMP.patch Mon Apr 25 01:10:06 2011 (r17251)
@@ -0,0 +1,100 @@
+Subject: [PATCH] powerpc/kexec: Fix build failure on 32-bit SMP
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Mon, 25 Apr 2011 02:04:31 +0100
+
+Commit b987812b3fcaf70fdf0037589e5d2f5f2453e6ce left
+crash_kexec_wait_realmode() undefined for UP.
+
+Commit 7c7a81b53e581d727d069cc45df5510516faac31 defined it for UP but
+left it undefined for 32-bit SMP.
+
+Seems like people are getting confused by nested #ifdef's, so move the
+definitions of crash_kexec_wait_realmode() after the #ifdef CONFIG_SMP
+section.
+
+Compile-tested with 32-bit UP, 32-bit SMP and 64-bit SMP configurations.
+
+Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
+---
+--- a/arch/powerpc/kernel/crash.c
++++ b/arch/powerpc/kernel/crash.c
+@@ -162,34 +162,6 @@
+ /* Leave the IPI callback set */
+ }
+
+-/* wait for all the CPUs to hit real mode but timeout if they don't come in */
+-#ifdef CONFIG_PPC_STD_MMU_64
+-static void crash_kexec_wait_realmode(int cpu)
+-{
+- unsigned int msecs;
+- int i;
+-
+- msecs = 10000;
+- for (i=0; i < NR_CPUS && msecs > 0; i++) {
+- if (i == cpu)
+- continue;
+-
+- while (paca[i].kexec_state < KEXEC_STATE_REAL_MODE) {
+- barrier();
+- if (!cpu_possible(i)) {
+- break;
+- }
+- if (!cpu_online(i)) {
+- break;
+- }
+- msecs--;
+- mdelay(1);
+- }
+- }
+- mb();
+-}
+-#endif /* CONFIG_PPC_STD_MMU_64 */
+-
+ /*
+ * This function will be called by secondary cpus or by kexec cpu
+ * if soft-reset is activated to stop some CPUs.
+@@ -234,7 +206,6 @@
+ }
+
+ #else /* ! CONFIG_SMP */
+-static inline void crash_kexec_wait_realmode(int cpu) {}
+
+ static void crash_kexec_prepare_cpus(int cpu)
+ {
+@@ -257,6 +228,36 @@
+ }
+ #endif /* CONFIG_SMP */
+
++/* wait for all the CPUs to hit real mode but timeout if they don't come in */
++#if defined(CONFIG_SMP) && defined(CONFIG_PPC_STD_MMU_64)
++static void crash_kexec_wait_realmode(int cpu)
++{
++ unsigned int msecs;
++ int i;
++
++ msecs = 10000;
++ for (i=0; i < NR_CPUS && msecs > 0; i++) {
++ if (i == cpu)
++ continue;
++
++ while (paca[i].kexec_state < KEXEC_STATE_REAL_MODE) {
++ barrier();
++ if (!cpu_possible(i)) {
++ break;
++ }
++ if (!cpu_online(i)) {
++ break;
++ }
++ msecs--;
++ mdelay(1);
++ }
++ }
++ mb();
++}
++#else
++static inline void crash_kexec_wait_realmode(int cpu) {}
++#endif /* CONFIG_SMP && CONFIG_PPC_STD_MMU_64 */
++
+ /*
+ * Register a function to be called on shutdown. Only use this if you
+ * can't reset your device in the second kernel.
More information about the Kernel-svn-changes
mailing list