lkml.org 
[lkml]   [2017]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 1/2] Introduce add_taint variant that does not print warning.
From
Date
From: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>

Some interrupt handler's may not be happy to call printk and would lead to
unexpected behavior or kernel panic. e.g. machine_check_early() from MCE
handler on OPAL based system. Introduce add_taint variant that does not call
printk.

Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
---
include/linux/kernel.h | 1 +
kernel/panic.c | 6 ++++++
2 files changed, 7 insertions(+)

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index cb09238..799943e 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -480,6 +480,7 @@ enum lockdep_ok {
LOCKDEP_NOW_UNRELIABLE
};
extern void add_taint(unsigned flag, enum lockdep_ok);
+extern void add_taint_no_warn(unsigned flag, enum lockdep_ok);
extern int test_taint(unsigned flag);
extern unsigned long get_taint(void);
extern int root_mountflags;
diff --git a/kernel/panic.c b/kernel/panic.c
index 08aa88d..d344ea3 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -392,6 +392,12 @@ void add_taint(unsigned flag, enum lockdep_ok lockdep_ok)
}
EXPORT_SYMBOL(add_taint);

+void add_taint_no_warn(unsigned flag, enum lockdep_ok lockdep_ok)
+{
+ set_bit(flag, &tainted_mask);
+}
+EXPORT_SYMBOL(add_taint_no_warn);
+
static void spin_msec(int msecs)
{
int i;
\
 
 \ /
  Last update: 2017-02-21 05:22    [W:0.092 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site