aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mips-boards/generic/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/mips-boards/generic/time.c')
-rw-r--r--arch/mips/mips-boards/generic/time.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/arch/mips/mips-boards/generic/time.c b/arch/mips/mips-boards/generic/time.c
index 72a12d931cba..93f3bf2c2b22 100644
--- a/arch/mips/mips-boards/generic/time.c
+++ b/arch/mips/mips-boards/generic/time.c
@@ -75,20 +75,31 @@ static void mips_timer_dispatch (struct pt_regs *regs)
75 do_IRQ (mips_cpu_timer_irq, regs); 75 do_IRQ (mips_cpu_timer_irq, regs);
76} 76}
77 77
78extern int null_perf_irq(struct pt_regs *regs);
79
80extern int (*perf_irq)(struct pt_regs *regs);
81
78irqreturn_t mips_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) 82irqreturn_t mips_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
79{ 83{
80#ifdef CONFIG_SMP 84 int r2 = cpu_has_mips_r2;
81 int cpu = smp_processor_id(); 85 int cpu = smp_processor_id();
82 86
83 if (cpu == 0) { 87 if (cpu == 0) {
84 /* 88 /*
85 * CPU 0 handles the global timer interrupt job and process accounting 89 * CPU 0 handles the global timer interrupt job and process
86 * resets count/compare registers to trigger next timer int. 90 * accounting resets count/compare registers to trigger next
91 * timer int.
87 */ 92 */
88 (void) timer_interrupt(irq, dev_id, regs); 93 if (!r2 || (read_c0_cause() & (1 << 26)))
94 if (perf_irq(regs))
95 goto out;
96
97 /* we keep interrupt disabled all the time */
98 if (!r2 || (read_c0_cause() & (1 << 30)))
99 timer_interrupt(irq, NULL, regs);
100
89 scroll_display_message(); 101 scroll_display_message();
90 } 102 } else {
91 else {
92 /* Everyone else needs to reset the timer int here as 103 /* Everyone else needs to reset the timer int here as
93 ll_local_timer_interrupt doesn't */ 104 ll_local_timer_interrupt doesn't */
94 /* 105 /*
@@ -103,16 +114,8 @@ irqreturn_t mips_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
103 local_timer_interrupt (irq, dev_id, regs); 114 local_timer_interrupt (irq, dev_id, regs);
104 } 115 }
105 116
117out:
106 return IRQ_HANDLED; 118 return IRQ_HANDLED;
107#else
108 irqreturn_t r;
109
110 r = timer_interrupt(irq, dev_id, regs);
111
112 scroll_display_message();
113
114 return r;
115#endif
116} 119}
117 120
118/* 121/*