]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
MIPS: Lemote 2F: cs5536: mfgpt: use raw locks
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Tue, 13 May 2014 15:07:04 +0000 (17:07 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Wed, 28 May 2014 08:48:26 +0000 (10:48 +0200)
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>
arch/mips/loongson/common/cs5536/cs5536_mfgpt.c

index c639b9db0012cbee3df5a24e21063c5af9832694..12c75db23420c70fd5ff7837a78554f15cecd606 100644 (file)
@@ -27,8 +27,7 @@
 
 #include <cs5536/cs5536_mfgpt.h>
 
-DEFINE_SPINLOCK(mfgpt_lock);
-EXPORT_SYMBOL(mfgpt_lock);
+static DEFINE_RAW_SPINLOCK(mfgpt_lock);
 
 static u32 mfgpt_base;
 
@@ -55,7 +54,7 @@ EXPORT_SYMBOL(enable_mfgpt0_counter);
 static void init_mfgpt_timer(enum clock_event_mode mode,
                             struct clock_event_device *evt)
 {
-       spin_lock(&mfgpt_lock);
+       raw_spin_lock(&mfgpt_lock);
 
        switch (mode) {
        case CLOCK_EVT_MODE_PERIODIC:
@@ -79,7 +78,7 @@ static void init_mfgpt_timer(enum clock_event_mode mode,
                /* Nothing to do here */
                break;
        }
-       spin_unlock(&mfgpt_lock);
+       raw_spin_unlock(&mfgpt_lock);
 }
 
 static struct clock_event_device mfgpt_clockevent = {
@@ -157,7 +156,7 @@ static cycle_t mfgpt_read(struct clocksource *cs)
        static int old_count;
        static u32 old_jifs;
 
-       spin_lock_irqsave(&mfgpt_lock, flags);
+       raw_spin_lock_irqsave(&mfgpt_lock, flags);
        /*
         * Although our caller may have the read side of xtime_lock,
         * this is now a seqlock, and we are cheating in this routine
@@ -191,7 +190,7 @@ static cycle_t mfgpt_read(struct clocksource *cs)
        old_count = count;
        old_jifs = jifs;
 
-       spin_unlock_irqrestore(&mfgpt_lock, flags);
+       raw_spin_unlock_irqrestore(&mfgpt_lock, flags);
 
        return (cycle_t) (jifs * COMPARE) + count;
 }