1 --- a/arch/mips/oprofile/op_model_mipsxx.c
2 +++ b/arch/mips/oprofile/op_model_mipsxx.c
3 @@ -298,6 +298,11 @@ static void reset_counters(void *arg)
7 +static irqreturn_t mipsxx_perfcount_int(int irq, void *dev_id)
9 + return mipsxx_perfcount_handler();
12 static int __init mipsxx_init(void)
15 @@ -374,6 +379,10 @@ static int __init mipsxx_init(void)
16 save_perf_irq = perf_irq;
17 perf_irq = mipsxx_perfcount_handler;
19 + if (cp0_perfcount_irq >= 0)
20 + return request_irq(cp0_perfcount_irq, mipsxx_perfcount_int,
21 + IRQF_SHARED, "Perfcounter", save_perf_irq);
26 @@ -381,6 +390,9 @@ static void mipsxx_exit(void)
28 int counters = op_model_mipsxx_ops.num_counters;
30 + if (cp0_perfcount_irq >= 0)
31 + free_irq(cp0_perfcount_irq, save_perf_irq);
33 counters = counters_per_cpu_to_total(counters);
34 on_each_cpu(reset_counters, (void *)(long)counters, 1);