lockdep, bug: Exclude TAINT_FIRMWARE_WORKAROUND from disabling lockdep
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Mon, 14 Nov 2011 12:13:49 +0000 (13:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Feb 2012 19:16:58 +0000 (11:16 -0800)
commit df754e6af2f237a6c020c0daff55a1a609338e31 upstream.

It's unlikely that TAINT_FIRMWARE_WORKAROUND causes false
lockdep messages, so do not disable lockdep in that case.
We still want to keep lockdep disabled in the
TAINT_OOT_MODULE case:

  - bin-only modules can cause various instabilities in
    their and in unrelated kernel code

  - they are impossible to debug for kernel developers

  - they also typically do not have the copyright license
    permission to link to the GPL-ed lockdep code.

Suggested-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-xopopjjens57r0i13qnyh2yo@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

kernel/panic.c

index b265936..1b83fd8 100644 (file)
@@ -240,8 +240,16 @@ void add_taint(unsigned flag)
         * Also we want to keep up lockdep for staging development and
         * post-warning case.
         */
-       if (flag != TAINT_CRAP && flag != TAINT_WARN && __debug_locks_off())
-               printk(KERN_WARNING "Disabling lock debugging due to kernel taint\n");
+       switch (flag) {
+       case TAINT_CRAP:
+       case TAINT_WARN:
+       case TAINT_FIRMWARE_WORKAROUND:
+               break;
+
+       default:
+               if (__debug_locks_off())
+                       printk(KERN_WARNING "Disabling lock debugging due to kernel taint\n");
+       }
 
        set_bit(flag, &tainted_mask);
 }