linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Introduce add_taint variant that does not print warning.
@ 2017-02-21  4:21 Mahesh J Salgaonkar
  2017-02-21  4:21 ` [PATCH 2/2] powerpc/book3s: mce: Use add_taint_no_warn() in machine_check_early() Mahesh J Salgaonkar
  0 siblings, 1 reply; 5+ messages in thread
From: Mahesh J Salgaonkar @ 2017-02-21  4:21 UTC (permalink / raw)
  To: linuxppc-dev, Linux Kernel, Michael Ellerman

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;

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-04-17 11:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-21  4:21 [PATCH 1/2] Introduce add_taint variant that does not print warning Mahesh J Salgaonkar
2017-02-21  4:21 ` [PATCH 2/2] powerpc/book3s: mce: Use add_taint_no_warn() in machine_check_early() Mahesh J Salgaonkar
2017-04-11 10:35   ` Michael Ellerman
2017-04-17 10:39   ` Daniel Axtens
2017-04-17 11:19     ` Mahesh Jagannath Salgaonkar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).