]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
powerpc: Fix bug in timebase synchronization on 32-bit SMP powermac
authorPaul Mackerras <paulus@samba.org>
Sat, 19 Nov 2005 10:24:55 +0000 (21:24 +1100)
committerPaul Mackerras <paulus@samba.org>
Sat, 19 Nov 2005 10:24:55 +0000 (21:24 +1100)
We were using udelay in the loop on the primary cpu waiting for the
secondary cpu to take the timebase value.  Unfortunately now that
udelay uses the timebase, and the timebase is stopped at this point,
the udelay never terminated.  This fixes it by not using udelay, and
increases the number of loops before we time out to compensate.

Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/platforms/powermac/smp.c

index 957b091034220553fc6d48545d88e256350a2ef7..fb2a7c798e8278c51e8019e844f5600c134006e2 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/errno.h>
 #include <linux/hardirq.h>
 #include <linux/cpu.h>
+#include <linux/compiler.h>
 
 #include <asm/ptrace.h>
 #include <asm/atomic.h>
@@ -631,8 +632,9 @@ void smp_core99_give_timebase(void)
        mb();
 
        /* wait for the secondary to have taken it */
-       for (t = 100000; t > 0 && sec_tb_reset; --t)
-               udelay(10);
+       /* note: can't use udelay here, since it needs the timebase running */
+       for (t = 10000000; t > 0 && sec_tb_reset; --t)
+               barrier();
        if (sec_tb_reset)
                /* XXX BUG_ON here? */
                printk(KERN_WARNING "Timeout waiting sync(2) on second CPU\n");