aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/irq.c')
-rw-r--r--arch/powerpc/kernel/irq.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 5c3c46948d94..701d4aceb4f4 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -115,6 +115,15 @@ static inline notrace void set_soft_enabled(unsigned long enable)
115 : : "r" (enable), "i" (offsetof(struct paca_struct, soft_enabled))); 115 : : "r" (enable), "i" (offsetof(struct paca_struct, soft_enabled)));
116} 116}
117 117
118static inline notrace void decrementer_check_overflow(void)
119{
120 u64 now = get_tb_or_rtc();
121 u64 *next_tb = &__get_cpu_var(decrementers_next_tb);
122
123 if (now >= *next_tb)
124 set_dec(1);
125}
126
118notrace void arch_local_irq_restore(unsigned long en) 127notrace void arch_local_irq_restore(unsigned long en)
119{ 128{
120 /* 129 /*
@@ -164,24 +173,21 @@ notrace void arch_local_irq_restore(unsigned long en)
164 */ 173 */
165 local_paca->hard_enabled = en; 174 local_paca->hard_enabled = en;
166 175
167#ifndef CONFIG_BOOKE 176 /*
168 /* On server, re-trigger the decrementer if it went negative since 177 * Trigger the decrementer if we have a pending event. Some processors
169 * some processors only trigger on edge transitions of the sign bit. 178 * only trigger on edge transitions of the sign bit. We might also
170 * 179 * have disabled interrupts long enough that the decrementer wrapped
171 * BookE has a level sensitive decrementer (latches in TSR) so we 180 * to positive.
172 * don't need that
173 */ 181 */
174 if ((int)mfspr(SPRN_DEC) < 0) 182 decrementer_check_overflow();
175 mtspr(SPRN_DEC, 1);
176#endif /* CONFIG_BOOKE */
177 183
178 /* 184 /*
179 * Force the delivery of pending soft-disabled interrupts on PS3. 185 * Force the delivery of pending soft-disabled interrupts on PS3.
180 * Any HV call will have this side effect. 186 * Any HV call will have this side effect.
181 */ 187 */
182 if (firmware_has_feature(FW_FEATURE_PS3_LV1)) { 188 if (firmware_has_feature(FW_FEATURE_PS3_LV1)) {
183 u64 tmp; 189 u64 tmp, tmp2;
184 lv1_get_version_info(&tmp); 190 lv1_get_version_info(&tmp, &tmp2);
185 } 191 }
186 192
187 __hard_irq_enable(); 193 __hard_irq_enable();