Skip to contentSkip to conversation

Oprofile: Loongson: Fixup of irq handler

PATCH In review Wu Zhangjin 2 participants 3 messages May 6, 2010 – May 11, 2010 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Oprofile: Loongson: Fixup of irq handler

The interrupt enable bit of performance counters of Loongson is in the control register($24), not in the counter register, so, in loongson2_perfcount_handler(), we need to use

	enabled = read_c0_perfctrl() & LOONGSON2_PERFCNT_INT_EN;

instead of

	enabled = read_c0_perfcnt() & LOONGSON2_PERFCNT_INT_EN;
---
 arch/mips/oprofile/op_model_loongson2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/mips/oprofile/op_model_loongson2.c +1 -1
index 29e2326..fa3bf66 100644
@@ -122,7 +122,7 @@ 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;
+	enabled = read_c0_perfctrl() & LOONGSON2_PERFCNT_INT_EN;
 	if (!enabled)
 		return IRQ_NONE;
 	enabled = reg.cnt1_enabled | reg.cnt2_enabled;
Signature · 1 line
1.7.0
#1 lore raw

Hi, Ralf

This one is urgent, could you please review it, thanks ;)

Regards,
Wu Zhangjin

Quoted 29 lines · Wu Zhangjin

The interrupt enable bit of performance counters of Loongson is in the control register($24), not in the counter register, so, in loongson2_perfcount_handler(), we need to use

	enabled = read_c0_perfctrl() & LOONGSON2_PERFCNT_INT_EN;

instead of

	enabled = read_c0_perfcnt() & LOONGSON2_PERFCNT_INT_EN;
---
 arch/mips/oprofile/op_model_loongson2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/mips/oprofile/op_model_loongson2.c +1 -1
index 29e2326..fa3bf66 100644
@@ -122,7 +122,7 @@ 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;
+	enabled = read_c0_perfctrl() & LOONGSON2_PERFCNT_INT_EN;
 	if (!enabled)
 		return IRQ_NONE;
 	enabled = reg.cnt1_enabled | reg.cnt2_enabled;