aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/oprofile
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/oprofile')
-rw-r--r--arch/mips/oprofile/common.c7
-rw-r--r--arch/mips/oprofile/op_model_loongson2.c9
2 files changed, 5 insertions, 11 deletions
diff --git a/arch/mips/oprofile/common.c b/arch/mips/oprofile/common.c
index 7832ad257a14..f9eb1aba6345 100644
--- a/arch/mips/oprofile/common.c
+++ b/arch/mips/oprofile/common.c
@@ -6,6 +6,7 @@
6 * Copyright (C) 2004, 2005 Ralf Baechle 6 * Copyright (C) 2004, 2005 Ralf Baechle
7 * Copyright (C) 2005 MIPS Technologies, Inc. 7 * Copyright (C) 2005 MIPS Technologies, Inc.
8 */ 8 */
9#include <linux/compiler.h>
9#include <linux/errno.h> 10#include <linux/errno.h>
10#include <linux/init.h> 11#include <linux/init.h>
11#include <linux/oprofile.h> 12#include <linux/oprofile.h>
@@ -14,9 +15,9 @@
14 15
15#include "op_impl.h" 16#include "op_impl.h"
16 17
17extern struct op_mips_model op_model_mipsxx_ops __attribute__((weak)); 18extern struct op_mips_model op_model_mipsxx_ops __weak;
18extern struct op_mips_model op_model_rm9000_ops __attribute__((weak)); 19extern struct op_mips_model op_model_rm9000_ops __weak;
19extern struct op_mips_model op_model_loongson2_ops __attribute__((weak)); 20extern struct op_mips_model op_model_loongson2_ops __weak;
20 21
21static struct op_mips_model *model; 22static struct op_mips_model *model;
22 23
diff --git a/arch/mips/oprofile/op_model_loongson2.c b/arch/mips/oprofile/op_model_loongson2.c
index 475ff46712ab..29e2326b6257 100644
--- a/arch/mips/oprofile/op_model_loongson2.c
+++ b/arch/mips/oprofile/op_model_loongson2.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2009 Lemote Inc. 4 * Copyright (C) 2009 Lemote Inc.
5 * Author: Yanhua <yanh@lemote.com> 5 * Author: Yanhua <yanh@lemote.com>
6 * Author: Wu Zhangjin <wuzj@lemote.com> 6 * Author: Wu Zhangjin <wuzhangjin@gmail.com>
7 * 7 *
8 * This file is subject to the terms and conditions of the GNU General Public 8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive 9 * License. See the file "COPYING" in the main directory of this archive
@@ -47,8 +47,6 @@ static struct loongson2_register_config {
47 int cnt1_enabled, cnt2_enabled; 47 int cnt1_enabled, cnt2_enabled;
48} reg; 48} reg;
49 49
50DEFINE_SPINLOCK(sample_lock);
51
52static char *oprofid = "LoongsonPerf"; 50static char *oprofid = "LoongsonPerf";
53static irqreturn_t loongson2_perfcount_handler(int irq, void *dev_id); 51static irqreturn_t loongson2_perfcount_handler(int irq, void *dev_id);
54/* Compute all of the registers in preparation for enabling profiling. */ 52/* Compute all of the registers in preparation for enabling profiling. */
@@ -115,7 +113,6 @@ static irqreturn_t loongson2_perfcount_handler(int irq, void *dev_id)
115 uint64_t counter, counter1, counter2; 113 uint64_t counter, counter1, counter2;
116 struct pt_regs *regs = get_irq_regs(); 114 struct pt_regs *regs = get_irq_regs();
117 int enabled; 115 int enabled;
118 unsigned long flags;
119 116
120 /* 117 /*
121 * LOONGSON2 defines two 32-bit performance counters. 118 * LOONGSON2 defines two 32-bit performance counters.
@@ -136,8 +133,6 @@ static irqreturn_t loongson2_perfcount_handler(int irq, void *dev_id)
136 counter1 = counter & 0xffffffff; 133 counter1 = counter & 0xffffffff;
137 counter2 = counter >> 32; 134 counter2 = counter >> 32;
138 135
139 spin_lock_irqsave(&sample_lock, flags);
140
141 if (counter1 & LOONGSON2_PERFCNT_OVERFLOW) { 136 if (counter1 & LOONGSON2_PERFCNT_OVERFLOW) {
142 if (reg.cnt1_enabled) 137 if (reg.cnt1_enabled)
143 oprofile_add_sample(regs, 0); 138 oprofile_add_sample(regs, 0);
@@ -149,8 +144,6 @@ static irqreturn_t loongson2_perfcount_handler(int irq, void *dev_id)
149 counter2 = reg.reset_counter2; 144 counter2 = reg.reset_counter2;
150 } 145 }
151 146
152 spin_unlock_irqrestore(&sample_lock, flags);
153
154 write_c0_perfcnt((counter2 << 32) | counter1); 147 write_c0_perfcnt((counter2 << 32) | counter1);
155 148
156 return IRQ_HANDLED; 149 return IRQ_HANDLED;