diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2014-05-13 11:07:04 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-05-28 04:48:26 -0400 |
commit | f02ffb199d3af57407a79075f3e0e6c0e8980b6c (patch) | |
tree | 6cfc60ce8a0b310debf7b3927951b5284722b1d0 | |
parent | bb6c0bd3fdb67c8a1fceea1d4700b9ee593309f9 (diff) |
MIPS: Lemote 2F: cs5536: mfgpt: use raw locks
The lock is taken in the raw irq path and therefore a rawlock should be
used instead of a normal spinlock.
While here I drop the export symbol on that variable since there are no
other users.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-mips@linux-mips.org
Cc: Hua Yan <yanh@lemote.com>
Cc: Huacai Chen <chenhc@lemote.com>
Cc: Alex Smith <alex.smith@imgtec.com>
Cc: Hongliang Tao <taohl@lemote.com>
Cc: Wu Zhangjin <wuzhangjin@gmail.com>
Patchwork: https://patchwork.linux-mips.org/patch/6936/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/loongson/common/cs5536/cs5536_mfgpt.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c b/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c index c639b9db0012..12c75db23420 100644 --- a/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c +++ b/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c | |||
@@ -27,8 +27,7 @@ | |||
27 | 27 | ||
28 | #include <cs5536/cs5536_mfgpt.h> | 28 | #include <cs5536/cs5536_mfgpt.h> |
29 | 29 | ||
30 | DEFINE_SPINLOCK(mfgpt_lock); | 30 | static DEFINE_RAW_SPINLOCK(mfgpt_lock); |
31 | EXPORT_SYMBOL(mfgpt_lock); | ||
32 | 31 | ||
33 | static u32 mfgpt_base; | 32 | static u32 mfgpt_base; |
34 | 33 | ||
@@ -55,7 +54,7 @@ EXPORT_SYMBOL(enable_mfgpt0_counter); | |||
55 | static void init_mfgpt_timer(enum clock_event_mode mode, | 54 | static void init_mfgpt_timer(enum clock_event_mode mode, |
56 | struct clock_event_device *evt) | 55 | struct clock_event_device *evt) |
57 | { | 56 | { |
58 | spin_lock(&mfgpt_lock); | 57 | raw_spin_lock(&mfgpt_lock); |
59 | 58 | ||
60 | switch (mode) { | 59 | switch (mode) { |
61 | case CLOCK_EVT_MODE_PERIODIC: | 60 | case CLOCK_EVT_MODE_PERIODIC: |
@@ -79,7 +78,7 @@ static void init_mfgpt_timer(enum clock_event_mode mode, | |||
79 | /* Nothing to do here */ | 78 | /* Nothing to do here */ |
80 | break; | 79 | break; |
81 | } | 80 | } |
82 | spin_unlock(&mfgpt_lock); | 81 | raw_spin_unlock(&mfgpt_lock); |
83 | } | 82 | } |
84 | 83 | ||
85 | static struct clock_event_device mfgpt_clockevent = { | 84 | static struct clock_event_device mfgpt_clockevent = { |
@@ -157,7 +156,7 @@ static cycle_t mfgpt_read(struct clocksource *cs) | |||
157 | static int old_count; | 156 | static int old_count; |
158 | static u32 old_jifs; | 157 | static u32 old_jifs; |
159 | 158 | ||
160 | spin_lock_irqsave(&mfgpt_lock, flags); | 159 | raw_spin_lock_irqsave(&mfgpt_lock, flags); |
161 | /* | 160 | /* |
162 | * Although our caller may have the read side of xtime_lock, | 161 | * Although our caller may have the read side of xtime_lock, |
163 | * this is now a seqlock, and we are cheating in this routine | 162 | * this is now a seqlock, and we are cheating in this routine |
@@ -191,7 +190,7 @@ static cycle_t mfgpt_read(struct clocksource *cs) | |||
191 | old_count = count; | 190 | old_count = count; |
192 | old_jifs = jifs; | 191 | old_jifs = jifs; |
193 | 192 | ||
194 | spin_unlock_irqrestore(&mfgpt_lock, flags); | 193 | raw_spin_unlock_irqrestore(&mfgpt_lock, flags); |
195 | 194 | ||
196 | return (cycle_t) (jifs * COMPARE) + count; | 195 | return (cycle_t) (jifs * COMPARE) + count; |
197 | } | 196 | } |