diff options
Diffstat (limited to 'arch/powerpc/platforms/pasemi/setup.c')
-rw-r--r-- | arch/powerpc/platforms/pasemi/setup.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c index 153051eb6d93..a4619347aa7e 100644 --- a/arch/powerpc/platforms/pasemi/setup.c +++ b/arch/powerpc/platforms/pasemi/setup.c | |||
@@ -71,20 +71,25 @@ static void pas_restart(char *cmd) | |||
71 | } | 71 | } |
72 | 72 | ||
73 | #ifdef CONFIG_SMP | 73 | #ifdef CONFIG_SMP |
74 | static DEFINE_SPINLOCK(timebase_lock); | 74 | static raw_spinlock_t timebase_lock; |
75 | static unsigned long timebase; | 75 | static unsigned long timebase; |
76 | 76 | ||
77 | static void __devinit pas_give_timebase(void) | 77 | static void __devinit pas_give_timebase(void) |
78 | { | 78 | { |
79 | spin_lock(&timebase_lock); | 79 | unsigned long flags; |
80 | |||
81 | local_irq_save(flags); | ||
82 | hard_irq_disable(); | ||
83 | __raw_spin_lock(&timebase_lock); | ||
80 | mtspr(SPRN_TBCTL, TBCTL_FREEZE); | 84 | mtspr(SPRN_TBCTL, TBCTL_FREEZE); |
81 | isync(); | 85 | isync(); |
82 | timebase = get_tb(); | 86 | timebase = get_tb(); |
83 | spin_unlock(&timebase_lock); | 87 | __raw_spin_unlock(&timebase_lock); |
84 | 88 | ||
85 | while (timebase) | 89 | while (timebase) |
86 | barrier(); | 90 | barrier(); |
87 | mtspr(SPRN_TBCTL, TBCTL_RESTART); | 91 | mtspr(SPRN_TBCTL, TBCTL_RESTART); |
92 | local_irq_restore(flags); | ||
88 | } | 93 | } |
89 | 94 | ||
90 | static void __devinit pas_take_timebase(void) | 95 | static void __devinit pas_take_timebase(void) |
@@ -92,10 +97,10 @@ static void __devinit pas_take_timebase(void) | |||
92 | while (!timebase) | 97 | while (!timebase) |
93 | smp_rmb(); | 98 | smp_rmb(); |
94 | 99 | ||
95 | spin_lock(&timebase_lock); | 100 | __raw_spin_lock(&timebase_lock); |
96 | set_tb(timebase >> 32, timebase & 0xffffffff); | 101 | set_tb(timebase >> 32, timebase & 0xffffffff); |
97 | timebase = 0; | 102 | timebase = 0; |
98 | spin_unlock(&timebase_lock); | 103 | __raw_spin_unlock(&timebase_lock); |
99 | } | 104 | } |
100 | 105 | ||
101 | struct smp_ops_t pas_smp_ops = { | 106 | struct smp_ops_t pas_smp_ops = { |