linux-mips
[Top] [All Lists]

[PATCH][1/2][MIPS] remove irqsave/irqrestore from spinlock for GT641xx c

To: Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH][1/2][MIPS] remove irqsave/irqrestore from spinlock for GT641xx clockevent
From: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Date: Tue, 23 Oct 2007 18:19:13 +0900
Cc: yoichi_yuasa@tripeaks.co.jp, linux-mips <linux-mips@linux-mips.org>
Organization: TriPeaks Corporation
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
set_next_event() and set_mode() are always called with interrupt disabled.
irqsave and irqrestore are not necessary for spinlock.
Pointed out by Atsushi Nemoto.

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>

diff -pruN -X mips/Documentation/dontdiff 
mips-orig/arch/mips/kernel/cevt-gt641xx.c mips/arch/mips/kernel/cevt-gt641xx.c
--- mips-orig/arch/mips/kernel/cevt-gt641xx.c   2007-10-23 15:24:41.135068000 
+0900
+++ mips/arch/mips/kernel/cevt-gt641xx.c        2007-10-23 16:15:57.040970000 
+0900
@@ -49,10 +49,9 @@ int gt641xx_timer0_state(void)
 static int gt641xx_timer0_set_next_event(unsigned long delta,
                                         struct clock_event_device *evt)
 {
-       unsigned long flags;
        u32 ctrl;
 
-       spin_lock_irqsave(&gt641xx_timer_lock, flags);
+       spin_lock(&gt641xx_timer_lock);
 
        ctrl = GT_READ(GT_TC_CONTROL_OFS);
        ctrl &= ~(GT_TC_CONTROL_ENTC0_MSK | GT_TC_CONTROL_SELTC0_MSK);
@@ -61,7 +60,7 @@ static int gt641xx_timer0_set_next_event
        GT_WRITE(GT_TC0_OFS, delta);
        GT_WRITE(GT_TC_CONTROL_OFS, ctrl);
 
-       spin_unlock_irqrestore(&gt641xx_timer_lock, flags);
+       spin_unlock(&gt641xx_timer_lock);
 
        return 0;
 }
@@ -69,10 +68,9 @@ static int gt641xx_timer0_set_next_event
 static void gt641xx_timer0_set_mode(enum clock_event_mode mode,
                                    struct clock_event_device *evt)
 {
-       unsigned long flags;
        u32 ctrl;
 
-       spin_lock_irqsave(&gt641xx_timer_lock, flags);
+       spin_lock(&gt641xx_timer_lock);
 
        ctrl = GT_READ(GT_TC_CONTROL_OFS);
        ctrl &= ~(GT_TC_CONTROL_ENTC0_MSK | GT_TC_CONTROL_SELTC0_MSK);
@@ -90,7 +88,7 @@ static void gt641xx_timer0_set_mode(enum
 
        GT_WRITE(GT_TC_CONTROL_OFS, ctrl);
 
-       spin_unlock_irqrestore(&gt641xx_timer_lock, flags);
+       spin_unlock(&gt641xx_timer_lock);
 }
 
 static void gt641xx_timer0_event_handler(struct clock_event_device *dev)

<Prev in Thread] Current Thread [Next in Thread>