212a7a51712ddce1e2559cd5a35bb211384e7691
[openwrt/staging/pepe2k.git] / target / linux / generic / patches-3.2 / 030-lockdep-bug-Exclude-TAINT_FIRMWARE_WORKAROUND-from-d.patch
1 From df754e6af2f237a6c020c0daff55a1a609338e31 Mon Sep 17 00:00:00 2001
2 From: Peter Zijlstra <a.p.zijlstra@chello.nl>
3 Date: Mon, 14 Nov 2011 13:13:49 +0100
4 Subject: [PATCH 1/2] lockdep, bug: Exclude TAINT_FIRMWARE_WORKAROUND from disabling lockdep
5
6 It's unlikely that TAINT_FIRMWARE_WORKAROUND causes false
7 lockdep messages, so do not disable lockdep in that case.
8 We still want to keep lockdep disabled in the
9 TAINT_OOT_MODULE case:
10
11 - bin-only modules can cause various instabilities in
12 their and in unrelated kernel code
13
14 - they are impossible to debug for kernel developers
15
16 - they also typically do not have the copyright license
17 permission to link to the GPL-ed lockdep code.
18
19 Suggested-by: Ben Hutchings <ben@decadent.org.uk>
20 Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
21 Link: http://lkml.kernel.org/n/tip-xopopjjens57r0i13qnyh2yo@git.kernel.org
22 Signed-off-by: Ingo Molnar <mingo@elte.hu>
23 ---
24 kernel/panic.c | 12 ++++++++++--
25 1 files changed, 10 insertions(+), 2 deletions(-)
26
27 --- a/kernel/panic.c
28 +++ b/kernel/panic.c
29 @@ -240,8 +240,16 @@ void add_taint(unsigned flag)
30 * Also we want to keep up lockdep for staging development and
31 * post-warning case.
32 */
33 - if (flag != TAINT_CRAP && flag != TAINT_WARN && __debug_locks_off())
34 - printk(KERN_WARNING "Disabling lock debugging due to kernel taint\n");
35 + switch (flag) {
36 + case TAINT_CRAP:
37 + case TAINT_WARN:
38 + case TAINT_FIRMWARE_WORKAROUND:
39 + break;
40 +
41 + default:
42 + if (__debug_locks_off())
43 + printk(KERN_WARNING "Disabling lock debugging due to kernel taint\n");
44 + }
45
46 set_bit(flag, &tainted_mask);
47 }