···507507 return IRQ_HANDLED;508508}509509510510+int null_perf_irq(struct pt_regs *regs)511511+{512512+ return 0;513513+}514514+515515+int (*perf_irq)(struct pt_regs *regs) = null_perf_irq;516516+517517+EXPORT_SYMBOL(null_perf_irq);518518+EXPORT_SYMBOL(perf_irq);519519+510520asmlinkage void ll_timer_interrupt(int irq, struct pt_regs *regs)511521{522522+ int r2 = cpu_has_mips_r2;523523+512524 irq_enter();513525 kstat_this_cpu.irqs[irq]++;514526515515- /* we keep interrupt disabled all the time */516516- timer_interrupt(irq, NULL, regs);527527+ /*528528+ * Suckage alert:529529+ * Before R2 of the architecture there was no way to see if a530530+ * performance counter interrupt was pending, so we have to run the531531+ * performance counter interrupt handler anyway.532532+ */533533+ if (!r2 || (read_c0_cause() & (1 << 26)))534534+ if (perf_irq(regs))535535+ goto out;517536537537+ /* we keep interrupt disabled all the time */538538+ if (!r2 || (read_c0_cause() & (1 << 30)))539539+ timer_interrupt(irq, NULL, regs);540540+541541+out:518542 irq_exit();519543}520544
+17-3
arch/mips/mips-boards/generic/time.c
···7575 do_IRQ (mips_cpu_timer_irq, regs);7676}77777878+extern int null_perf_irq(struct pt_regs *regs);7979+8080+extern int (*perf_irq)(struct pt_regs *regs);8181+7882irqreturn_t mips_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)7983{8484+ int r2 = cpu_has_mips_r2;8085 int cpu = smp_processor_id();81868287 if (cpu == 0) {8388 /*8484- * CPU 0 handles the global timer interrupt job and process accounting8585- * resets count/compare registers to trigger next timer int.8989+ * CPU 0 handles the global timer interrupt job and process9090+ * accounting resets count/compare registers to trigger next9191+ * timer int.8692 */8787- timer_interrupt(irq, dev_id, regs);9393+ if (!r2 || (read_c0_cause() & (1 << 26)))9494+ if (perf_irq(regs))9595+ goto out;9696+9797+ /* we keep interrupt disabled all the time */9898+ if (!r2 || (read_c0_cause() & (1 << 30)))9999+ timer_interrupt(irq, NULL, regs);100100+88101 scroll_display_message();89102 } else {90103 /* Everyone else needs to reset the timer int here as···114101 local_timer_interrupt (irq, dev_id, regs);115102 }116103104104+out:117105 return IRQ_HANDLED;118106}119107
+2-2
arch/mips/oprofile/op_impl.h
···12121313struct pt_regs;14141515-extern void null_perf_irq(struct pt_regs *regs);1616-extern void (*perf_irq)(struct pt_regs *regs);1515+extern int null_perf_irq(struct pt_regs *regs);1616+extern int (*perf_irq)(struct pt_regs *regs);17171818/* Per-counter configuration as set via oprofilefs. */1919struct op_counter_config {