aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powermac/smp.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2005-11-19 05:24:55 -0500
committerPaul Mackerras <paulus@samba.org>2005-11-19 05:24:55 -0500
commit54c4e6b5fee0347ab81e2c2fe4239c455c3422ae (patch)
tree4487d2642ecd1ccdf7ccdb6202780507fa95b5da /arch/powerpc/platforms/powermac/smp.c
parent0212ddd839470f7a54cccccbaecd4833b4123da2 (diff)
powerpc: Fix bug in timebase synchronization on 32-bit SMP powermac
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>
Diffstat (limited to 'arch/powerpc/platforms/powermac/smp.c')
-rw-r--r--arch/powerpc/platforms/powermac/smp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index 957b09103422..fb2a7c798e82 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -34,6 +34,7 @@
34#include <linux/errno.h> 34#include <linux/errno.h>
35#include <linux/hardirq.h> 35#include <linux/hardirq.h>
36#include <linux/cpu.h> 36#include <linux/cpu.h>
37#include <linux/compiler.h>
37 38
38#include <asm/ptrace.h> 39#include <asm/ptrace.h>
39#include <asm/atomic.h> 40#include <asm/atomic.h>
@@ -631,8 +632,9 @@ void smp_core99_give_timebase(void)
631 mb(); 632 mb();
632 633
633 /* wait for the secondary to have taken it */ 634 /* wait for the secondary to have taken it */
634 for (t = 100000; t > 0 && sec_tb_reset; --t) 635 /* note: can't use udelay here, since it needs the timebase running */
635 udelay(10); 636 for (t = 10000000; t > 0 && sec_tb_reset; --t)
637 barrier();
636 if (sec_tb_reset) 638 if (sec_tb_reset)
637 /* XXX BUG_ON here? */ 639 /* XXX BUG_ON here? */
638 printk(KERN_WARNING "Timeout waiting sync(2) on second CPU\n"); 640 printk(KERN_WARNING "Timeout waiting sync(2) on second CPU\n");