summaryrefslogtreecommitdiffstats
path: root/include/asm-generic/atomic.h
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2010-08-09 17:18:24 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-09 20:44:54 -0700
commit9e58143dc08123c22c5b9f782b2913bd3a07a03d (patch)
treefe315688cb22a9c0e9758018ee21e5397264a015 /include/asm-generic/atomic.h
parentfa260c00c1aa5c657793a7221e40d2400df5afd8 (diff)
downloadlinux-9e58143dc08123c22c5b9f782b2913bd3a07a03d.tar.bz2
asm-generic: use raw_local_irq_save/restore instead local_irq_save/restore
The start/stop_critical_timing functions for preemptirqsoff, preemptoff and irqsoff tracers contain atomic_inc() and atomic_dec() operations. Atomic operations use local_irq_save/restore macros to ensure atomic access but they are traced by the same function which is causing recursion problem. The reason is when these tracers are turn ON then the local_irq_save/restore macros are changed in include/linux/irqflags.h to call trace_hardirqs_on/off which call start/stop_critical_timing. Microblaze was affected because it uses generic atomic implementation. Signed-off-by: Michal Simek <monstr@monstr.eu> Acked-by: Steven Rostedt <rostedt@goodmis.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-generic/atomic.h')
-rw-r--r--include/asm-generic/atomic.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h
index 058129e9b04c..e53347fbf1da 100644
--- a/include/asm-generic/atomic.h
+++ b/include/asm-generic/atomic.h
@@ -57,11 +57,11 @@ static inline int atomic_add_return(int i, atomic_t *v)
unsigned long flags;
int temp;
- local_irq_save(flags);
+ raw_local_irq_save(flags); /* Don't trace it in a irqsoff handler */
temp = v->counter;
temp += i;
v->counter = temp;
- local_irq_restore(flags);
+ raw_local_irq_restore(flags);
return temp;
}
@@ -78,11 +78,11 @@ static inline int atomic_sub_return(int i, atomic_t *v)
unsigned long flags;
int temp;
- local_irq_save(flags);
+ raw_local_irq_save(flags); /* Don't trace it in a irqsoff handler */
temp = v->counter;
temp -= i;
v->counter = temp;
- local_irq_restore(flags);
+ raw_local_irq_restore(flags);
return temp;
}
@@ -135,9 +135,9 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
unsigned long flags;
mask = ~mask;
- local_irq_save(flags);
+ raw_local_irq_save(flags); /* Don't trace it in a irqsoff handler */
*addr &= mask;
- local_irq_restore(flags);
+ raw_local_irq_restore(flags);
}
#define atomic_xchg(ptr, v) (xchg(&(ptr)->counter, (v)))