diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2016-08-29 15:56:13 -0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2016-08-29 15:56:13 -0400 |
commit | 3e2316bfdad9eaf86f56ec94d24f601597b6e674 (patch) | |
tree | bf793554039396fe9483dbe2c1e64a4cd3d4d40e | |
parent | 3a8a30498369947fc80b8872b1e7fe3bf923c5af (diff) | |
download | 4.8-rt-patches-3e2316bfdad9eaf86f56ec94d24f601597b6e674.tar.gz |
printk: patch refresh
-rw-r--r-- | patches/printk-kill.patch | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/patches/printk-kill.patch b/patches/printk-kill.patch index 5bda7a70ed50b..c62a185d56f39 100644 --- a/patches/printk-kill.patch +++ b/patches/printk-kill.patch @@ -1,17 +1,15 @@ -Subject: printk: Add a printk kill switch +From 48d672df39a6adea156af6c8d7083b620578cf32 Mon Sep 17 00:00:00 2001 From: Ingo Molnar <mingo@elte.hu> Date: Fri, 22 Jul 2011 17:58:40 +0200 +Subject: [PATCH] printk: Add a printk kill switch Add a prinkt-kill-switch. This is used from (NMI) watchdog to ensure that it does not dead-lock with the early printk code. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> ---- - include/linux/printk.h | 2 + - kernel/printk/printk.c | 79 ++++++++++++++++++++++++++++++++++++------------- - kernel/watchdog.c | 10 ++++++ - 3 files changed, 71 insertions(+), 20 deletions(-) +diff --git a/include/linux/printk.h b/include/linux/printk.h +index f4da695fd615..cfd34c12c0a0 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -117,9 +117,11 @@ do { \ @@ -25,12 +23,14 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> +static inline void printk_kill(void) { } #endif - typedef __printf(1, 0) int (*printk_func_t)(const char *fmt, va_list args); + #ifdef CONFIG_PRINTK_NMI +diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c +index 60cdf6386763..80e0946b0e9c 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -246,6 +246,58 @@ struct printk_log { +@@ -247,6 +247,58 @@ __packed __aligned(4) */ - static DEFINE_RAW_SPINLOCK(logbuf_lock); + DEFINE_RAW_SPINLOCK(logbuf_lock); +#ifdef CONFIG_EARLY_PRINTK +struct console *early_console; @@ -87,7 +87,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> #ifdef CONFIG_PRINTK DECLARE_WAIT_QUEUE_HEAD(log_wait); /* the next printk record to read by syslog(READ) or /proc/kmsg */ -@@ -1620,6 +1672,13 @@ asmlinkage int vprintk_emit(int facility +@@ -1622,6 +1674,13 @@ asmlinkage int vprintk_emit(int facility, int level, /* cpu currently holding logbuf_lock in this function */ static unsigned int logbuf_cpu = UINT_MAX; @@ -101,7 +101,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (level == LOGLEVEL_SCHED) { level = LOGLEVEL_DEFAULT; in_sched = true; -@@ -1901,26 +1960,6 @@ DEFINE_PER_CPU(printk_func_t, printk_fun +@@ -1894,26 +1953,6 @@ DEFINE_PER_CPU(printk_func_t, printk_func); #endif /* CONFIG_PRINTK */ @@ -128,9 +128,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> static int __add_preferred_console(char *name, int idx, char *options, char *brl_options) { +diff --git a/kernel/watchdog.c b/kernel/watchdog.c +index 9acb29f280ec..7884a6248e8b 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c -@@ -315,6 +315,8 @@ static int is_softlockup(unsigned long t +@@ -315,6 +315,8 @@ static int is_softlockup(unsigned long touch_ts) #ifdef CONFIG_HARDLOCKUP_DETECTOR @@ -139,7 +141,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> static struct perf_event_attr wd_hw_attr = { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CPU_CYCLES, -@@ -349,6 +351,13 @@ static void watchdog_overflow_callback(s +@@ -349,6 +351,13 @@ static void watchdog_overflow_callback(struct perf_event *event, /* only print hardlockups once */ if (__this_cpu_read(hard_watchdog_warn) == true) return; @@ -153,7 +155,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> pr_emerg("Watchdog detected hard LOCKUP on cpu %d", this_cpu); print_modules(); -@@ -366,6 +375,7 @@ static void watchdog_overflow_callback(s +@@ -366,6 +375,7 @@ static void watchdog_overflow_callback(struct perf_event *event, !test_and_set_bit(0, &hardlockup_allcpu_dumped)) trigger_allbutself_cpu_backtrace(); @@ -161,3 +163,6 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (hardlockup_panic) nmi_panic(regs, "Hard LOCKUP"); +-- +2.5.0 + |