Skip to contentSkip to conversation

Don't print lockdep taint message for !LOCKDEP

PATCH New Andi Kleen 1 participant 1 message Apr 19, 2009

lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/1 Don't print lockdep taint message for !LOCKDEP

Don't print lockdep taint message for !LOCKDEP

I was surprised to see a

Disabling lockdep due to kernel taint

message in my lockdep disabled kernel. This patch ifdefs this message to not be printed when lockdep is not enabled.

BTW in my case it was due to a thermal event. I'm not sure it's really needed to disable lockdep on thermal events, but I left this alone for now.

---
 kernel/panic.c |    2 ++
 1 file changed, 2 insertions(+)
kernel/panic.c +2 -0
Index: linux-2.6.30-rc2-ak/kernel/panic.c
===================================================================
@@ -213,6 +213,7 @@
 
 void add_taint(unsigned flag)
 {
+#ifdef CONFIG_LOCKDEP
 	/*
 	 * Can't trust the integrity of the kernel anymore.
 	 * We don't call directly debug_locks_off() because the issue
@@ -222,6 +223,7 @@
 	 */
 	if (flag != TAINT_CRAP && flag != TAINT_WARN && __debug_locks_off())
 		printk(KERN_WARNING "Disabling lockdep due to kernel taint\n");
+#endif
 
 	set_bit(flag, &tainted_mask);
 }