Oprofile: Loongson: Fixup of irq handler
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;
Reported-by Xu Hengyang <[email protected]>
Signed-off-by Wu Zhangjin <[email protected]>
--- arch/mips/oprofile/op_model_loongson2.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/mips/oprofile/op_model_loongson2.c +1 -1
@@ -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
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 useenabled = read_c0_perfctrl() & LOONGSON2_PERFCNT_INT_EN;instead of
enabled = read_c0_perfcnt() & LOONGSON2_PERFCNT_INT_EN;Reported-by Xu Hengyang <[email protected]>Signed-off-by Wu Zhangjin <[email protected]>--- arch/mips/oprofile/op_model_loongson2.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/mips/oprofile/op_model_loongson2.c +1
-1@@ -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;
Thanks Wu, applied!
Ralf