[PATCH] powerpc: Fix setting of oprofile cpu type
Benjamin Herrenschmidt
benh at kernel.crashing.org
Thu Apr 30 15:39:38 EST 2009
commit 2657dd4e301d4841ed67a4fac7d145ad8f3e1b28 introduced a
bug where we would now always override the "real" oprofile CPU
type with the "compatible" one provided by a pseudo-PVR in the
device-tree which is incorrect and breaks oprofile on all current
configs since the "compatible" ones aren't yet recognized.
This fixes it.
Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
Bug hit 2.6.29 too. I'll send this to Linus and Greg tomorrow unless
somebody thinks it's wrong. I've tested on POWER6 and verified the
bug and the fix.
arch/powerpc/kernel/cputable.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- linux-work.orig/arch/powerpc/kernel/cputable.c 2009-04-30 14:22:30.000000000 +1000
+++ linux-work/arch/powerpc/kernel/cputable.c 2009-04-30 14:22:41.000000000 +1000
@@ -1833,8 +1833,8 @@ static void __init setup_cpu_spec(unsign
* and, in that case, keep the current value for
* oprofile_cpu_type.
*/
- if (old.oprofile_cpu_type == NULL)
- t->oprofile_cpu_type = s->oprofile_cpu_type;
+ if (old.oprofile_cpu_type != NULL)
+ t->oprofile_cpu_type = old.oprofile_cpu_type;
}
*PTRRELOC(&cur_cpu_spec) = &the_cpu_spec;
More information about the Linuxppc-dev
mailing list