+ printk-nmi-generic-solution-for-safe-printk-in-nmi-fix.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: printk/nmi: restore printk_func in nmi_panic
has been added to the -mm tree.  Its filename is
     printk-nmi-generic-solution-for-safe-printk-in-nmi-fix.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/printk-nmi-generic-solution-for-safe-printk-in-nmi-fix.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/printk-nmi-generic-solution-for-safe-printk-in-nmi-fix.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Sergey Senozhatsky <sergey.senozhatsky.work@xxxxxxxxx>
Subject: printk/nmi: restore printk_func in nmi_panic

When watchdog detects a hardlockup and calls nmi_panic() `printk_func'
must be restored via printk_nmi_exit() call, so panic() will be able
to flush nmi buf and show backtrace and panic message. We also better
explicitly ask nmi to printk_nmi_flush() in console_flush_on_panic(),
because it may be too late to rely on irq work.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@xxxxxxxxx>
Cc: Petr Mladek <pmladek@xxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 include/linux/kernel.h |    6 ++++--
 kernel/printk/printk.c |    1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff -puN include/linux/kernel.h~printk-nmi-generic-solution-for-safe-printk-in-nmi-fix include/linux/kernel.h
--- a/include/linux/kernel.h~printk-nmi-generic-solution-for-safe-printk-in-nmi-fix
+++ a/include/linux/kernel.h
@@ -467,10 +467,12 @@ do {									\
 	cpu = raw_smp_processor_id();					\
 	old_cpu = atomic_cmpxchg(&panic_cpu, PANIC_CPU_INVALID, cpu);	\
 									\
-	if (old_cpu == PANIC_CPU_INVALID)				\
+	if (old_cpu == PANIC_CPU_INVALID) {				\
+		printk_nmi_exit();					\
 		panic(fmt, ##__VA_ARGS__);				\
-	else if (old_cpu != cpu)					\
+	} else if (old_cpu != cpu) {					\
 		nmi_panic_self_stop(regs);				\
+	}								\
 } while (0)
 
 /*
diff -puN kernel/printk/printk.c~printk-nmi-generic-solution-for-safe-printk-in-nmi-fix kernel/printk/printk.c
--- a/kernel/printk/printk.c~printk-nmi-generic-solution-for-safe-printk-in-nmi-fix
+++ a/kernel/printk/printk.c
@@ -2392,6 +2392,7 @@ void console_flush_on_panic(void)
 	 */
 	console_trylock();
 	console_may_schedule = 0;
+	printk_nmi_flush();
 	console_unlock();
 }
 
_

Patches currently in -mm which might be from sergey.senozhatsky.work@xxxxxxxxx are

printk-nmi-generic-solution-for-safe-printk-in-nmi-fix.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux