Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+4 -2
+4 -2
arch/powerpc/platforms/powermac/smp.c
··· 34 34 #include <linux/errno.h> 35 35 #include <linux/hardirq.h> 36 36 #include <linux/cpu.h> 37 + #include <linux/compiler.h> 37 38 38 39 #include <asm/ptrace.h> 39 40 #include <asm/atomic.h> ··· 632 631 mb(); 633 632 634 633 /* wait for the secondary to have taken it */ 635 - for (t = 100000; t > 0 && sec_tb_reset; --t) 636 - udelay(10); 634 + /* note: can't use udelay here, since it needs the timebase running */ 635 + for (t = 10000000; t > 0 && sec_tb_reset; --t) 636 + barrier(); 637 637 if (sec_tb_reset) 638 638 /* XXX BUG_ON here? */ 639 639 printk(KERN_WARNING "Timeout waiting sync(2) on second CPU\n");