I previously sent a patch by Mikael Pettersson to fix the UP+preempt
problem. It seems from your BK repository you have not yet merged it;
if so, this patch takes a different approach which is optimal, removing
the unneeded conditional altogether in the UP case. I have verified UP
and SMP are now correct. Patch is against 2.5.4, please apply.
Robert Love
#ifdef CONFIG_SMP
#define kernel_locked() spin_is_locked(&kernel_flag)
+#define check_irq_holder(cpu) \
+do { \
+ if (global_irq_holder == (cpu)) \
+ BUG(); \
+} while(0)
#else
#ifdef CONFIG_PREEMPT
#define kernel_locked() preempt_get_count()
-#define global_irq_holder 0
+#define check_irq_holder(cpu) do { } while(0)
#else
#define kernel_locked() 1
#endif
do { \
if (unlikely(task->lock_depth >= 0)) { \
spin_unlock(&kernel_flag); \
- if (global_irq_holder == (cpu)) \
- BUG(); \
+ check_irq_holder(cpu); \
} \
} while (0)