MIPS: oprofile: Only do performance counter handling for counter interrupts
authorWu Zhangjin <wuzhangjin@gmail.com>
Fri, 6 Nov 2009 10:45:06 +0000 (18:45 +0800)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 17 Dec 2009 01:57:10 +0000 (01:57 +0000)
In Loongson2f IP6 is shared by bonito and perfcounters so we need to avoid
do_IRQ for perfcounter when the interrupt is from bonito.

Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/oprofile/op_model_loongson2.c

index 575cd14..475ff46 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Loongson2 performance counter driver for oprofile
  *
- * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology
+ * Copyright (C) 2009 Lemote Inc.
  * Author: Yanhua <yanh@lemote.com>
  * Author: Wu Zhangjin <wuzj@lemote.com>
  *
@@ -125,6 +125,9 @@ static irqreturn_t loongson2_perfcount_handler(int irq, void *dev_id)
         */
 
        /* Check whether the irq belongs to me */
+       enabled = read_c0_perfcnt() & LOONGSON2_PERFCNT_INT_EN;
+       if (!enabled)
+               return IRQ_NONE;
        enabled = reg.cnt1_enabled | reg.cnt2_enabled;
        if (!enabled)
                return IRQ_NONE;