linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] printk: ignore recursion_bug flag when MCE in progress
@ 2012-05-23  1:58 ShuoX Liu
  2012-05-23 10:01 ` Borislav Petkov
  0 siblings, 1 reply; 42+ messages in thread
From: ShuoX Liu @ 2012-05-23  1:58 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org; +Cc: andi, Andrew Morton, Yanmin Zhang

From: ShuoX Liu <shuox.liu@intel.com>

When MCE happens in printk, we ignore recursion_bug to make sure
some MCE logs printed out. Re-use mce_entry variable.

Signed-off-by: Yanmin Zhang <yanmin_zhang@linux.intel.com>
Signed-off-by: ShuoX Liu <shuox.liu@intel.com>
---
I found mce_entry was introduced by commit 553f265f, but it's not
used now. Why not removed?
---
 arch/x86/include/asm/mce.h       |    2 --
 arch/x86/kernel/cpu/mcheck/mce.c |    2 --
 include/linux/kernel.h           |    1 +
 kernel/printk.c                  |    4 +++-
 4 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
index 441520e..aeda4cc 100644
--- a/arch/x86/include/asm/mce.h
+++ b/arch/x86/include/asm/mce.h
@@ -187,8 +187,6 @@ int mce_available(struct cpuinfo_x86 *c);
 DECLARE_PER_CPU(unsigned, mce_exception_count);
 DECLARE_PER_CPU(unsigned, mce_poll_count);
 
-extern atomic_t mce_entry;
-
 typedef DECLARE_BITMAP(mce_banks_t, MAX_NR_BANKS);
 DECLARE_PER_CPU(mce_banks_t, mce_poll_banks);
 
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 11c9166..6073354 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -61,8 +61,6 @@ int mce_disabled __read_mostly;
 
 #define SPINUNIT 100	/* 100ns */
 
-atomic_t mce_entry;
-
 DEFINE_PER_CPU(unsigned, mce_exception_count);
 
 /*
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 645231c..24af685 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -354,6 +354,7 @@ unsigned long int_sqrt(unsigned long);
 extern void bust_spinlocks(int yes);
 extern void wake_up_klogd(void);
 extern int oops_in_progress;		/* If set, an oops, panic(), BUG() or die() is in progress */
+extern atomic_t mce_entry;
 extern int panic_timeout;
 extern int panic_on_oops;
 extern int panic_on_unrecovered_nmi;
diff --git a/kernel/printk.c b/kernel/printk.c
index 473afdb..2bae087 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -79,6 +79,7 @@ int console_printk[4] = {
 int oops_in_progress;
 EXPORT_SYMBOL(oops_in_progress);
 
+atomic_t mce_entry;
 /*
  * console_sem protects the console_drivers list, and also
  * provides serialisation for access to the entire console
@@ -864,7 +865,8 @@ asmlinkage int vprintk(const char *fmt, va_list args)
 		 * recursion and return - but flag the recursion so that
 		 * it can be printed at the next appropriate moment:
 		 */
-		if (!oops_in_progress && !lockdep_recursing(current)) {
+		if (!oops_in_progress && !atomic_read(&mce_entry)
+				&& !lockdep_recursing(current)) {
 			recursion_bug = 1;
 			goto out_restore_irqs;
 		}
-- 
1.7.1

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

end of thread, other threads:[~2012-06-26 20:46 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-23  1:58 [PATCH] printk: ignore recursion_bug flag when MCE in progress ShuoX Liu
2012-05-23 10:01 ` Borislav Petkov
2012-05-24  0:38   ` Yanmin Zhang
2012-05-24  5:59   ` [PATCH v2] printk: ignore recursion_bug flag in HW error handle process ShuoX Liu
2012-05-24  6:11     ` Borislav Petkov
2012-05-24 22:56       ` Andrew Morton
2012-05-25  0:30         ` Yanmin Zhang
2012-05-25  7:19           ` [PATCH 1/2] printk: add interface for disabling recursion check ShuoX Liu
2012-05-25  7:21             ` [PATCH 2/2] x86 mce: use new printk recursion disabling interface ShuoX Liu
2012-05-25  7:41               ` Borislav Petkov
2012-05-25  8:00                 ` ShuoX Liu
2012-05-28  2:07                 ` ShuoX Liu
2012-05-30  9:08                   ` Borislav Petkov
2012-05-31  0:30                     ` Yanmin Zhang
2012-06-04  3:04                     ` [PATCH v4 1/2] printk: add interface for disabling recursion check ShuoX Liu
2012-06-04  3:07                       ` [PATCH v4 2/2] x86 mce: use new printk recursion disabling interface ShuoX Liu
2012-06-22 23:41                         ` Andrew Morton
2012-06-26 20:45                           ` Borislav Petkov
2012-05-25 16:09             ` [PATCH 1/2] printk: add interface for disabling recursion check Luck, Tony
2012-05-28  0:30               ` Yanmin Zhang
2012-05-28  2:54                 ` [PATCH v3 " ShuoX Liu
2012-05-28  2:56                   ` [PATCH v3 2/2] x86 mce: use new printk recursion disabling interface ShuoX Liu
2012-06-04 17:12                     ` Borislav Petkov
2012-06-05  0:32                       ` Yanmin Zhang
2012-06-05  8:14                         ` Borislav Petkov
2012-06-05  9:53                           ` [PATCH v5 1/2] printk: add interface for disabling recursion check ShuoX Liu
2012-06-05  9:55                             ` [PATCH v5 2/2] x86 mce: use new printk recursion disabling interface ShuoX Liu
2012-06-05 15:15                               ` Borislav Petkov
2012-06-06  0:36                                 ` Yanmin Zhang
2012-06-06  8:31                                   ` [PATCH v6 1/2] printk: add interface for disabling recursion check ShuoX Liu
2012-06-06  8:34                                     ` [PATCH v6 2/2] x86 mce: use new printk recursion disabling interface ShuoX Liu
2012-06-06 15:22                                       ` Borislav Petkov
2012-06-07  2:13                                         ` Yanmin Zhang
2012-06-07  2:57                                         ` [PATCH v7 1/2] printk: add interface for disabling recursion check ShuoX Liu
2012-06-07  3:00                                           ` [PATCH v7 2/2] x86 mce: use new printk recursion disabling interface ShuoX Liu
2012-06-08 12:34                                             ` Borislav Petkov
2012-06-25  9:17                                             ` Ingo Molnar
2012-06-25 13:14                                               ` Peter Zijlstra
2012-06-26 20:43                                                 ` Borislav Petkov
2012-06-07 13:19                                           ` [PATCH v7 1/2] printk: add interface for disabling recursion check bing deng
2012-06-07 13:38                                             ` Borislav Petkov
2012-06-08 12:30                                           ` Borislav Petkov

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).