mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] spin_lock_irq debugging
@ 2003-05-21 20:08 Duncan Sands
  0 siblings, 0 replies; only message in thread
From: Duncan Sands @ 2003-05-21 20:08 UTC (permalink / raw)
  To: linux-kernel

Of course the real problem is the corresponding spin_unlock_irq
enabling local irqs when they should have been left disabled, but
this is easier to check for.  Your logs will fill up.

diff -Nru a/include/linux/spinlock.h b/include/linux/spinlock.h
--- a/include/linux/spinlock.h	Wed May 21 22:04:29 2003
+++ b/include/linux/spinlock.h	Wed May 21 22:04:29 2003
@@ -261,6 +261,10 @@
 
 #define spin_lock_irq(lock) \
 do { \
+	if (unlikely(irqs_disabled())) { \
+		printk(KERN_ERR "bad: spin_lock_irq with irqs disabled!\n"); \
+		dump_stack(); \
+	} \
 	local_irq_disable(); \
 	preempt_disable(); \
 	_raw_spin_lock(lock); \


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-05-21 19:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-21 20:08 [PATCH] spin_lock_irq debugging Duncan Sands

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®