aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/printk.c
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2011-01-09 17:46:24 -0500
committerJames Morris <jmorris@namei.org>2011-01-09 17:46:24 -0500
commitd2e7ad19229f982fc1eb731827d82ceac90abfb3 (patch)
tree98a3741b4d4b27a48b3c7ea9babe331e539416a8 /kernel/printk.c
parentd03a5d888fb688c832d470b749acc5ed38e0bc1d (diff)
parent0c21e3aaf6ae85bee804a325aa29c325209180fd (diff)
Merge branch 'master' into next
Conflicts: security/smack/smack_lsm.c Verified and added fix by Stephen Rothwell <sfr@canb.auug.org.au> Ok'd by Casey Schaufler <casey@schaufler-ca.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'kernel/printk.c')
-rw-r--r--kernel/printk.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index 0cecba059666..f64b8997fc76 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -43,12 +43,6 @@
43#include <asm/uaccess.h> 43#include <asm/uaccess.h>
44 44
45/* 45/*
46 * for_each_console() allows you to iterate on each console
47 */
48#define for_each_console(con) \
49 for (con = console_drivers; con != NULL; con = con->next)
50
51/*
52 * Architectures can override it: 46 * Architectures can override it:
53 */ 47 */
54void asmlinkage __attribute__((weak)) early_printk(const char *fmt, ...) 48void asmlinkage __attribute__((weak)) early_printk(const char *fmt, ...)
@@ -1080,21 +1074,23 @@ static DEFINE_PER_CPU(int, printk_pending);
1080 1074
1081void printk_tick(void) 1075void printk_tick(void)
1082{ 1076{
1083 if (__get_cpu_var(printk_pending)) { 1077 if (__this_cpu_read(printk_pending)) {
1084 __get_cpu_var(printk_pending) = 0; 1078 __this_cpu_write(printk_pending, 0);
1085 wake_up_interruptible(&log_wait); 1079 wake_up_interruptible(&log_wait);
1086 } 1080 }
1087} 1081}
1088 1082
1089int printk_needs_cpu(int cpu) 1083int printk_needs_cpu(int cpu)
1090{ 1084{
1091 return per_cpu(printk_pending, cpu); 1085 if (cpu_is_offline(cpu))
1086 printk_tick();
1087 return __this_cpu_read(printk_pending);
1092} 1088}
1093 1089
1094void wake_up_klogd(void) 1090void wake_up_klogd(void)
1095{ 1091{
1096 if (waitqueue_active(&log_wait)) 1092 if (waitqueue_active(&log_wait))
1097 __raw_get_cpu_var(printk_pending) = 1; 1093 this_cpu_write(printk_pending, 1);
1098} 1094}
1099 1095
1100/** 1096/**
@@ -1363,6 +1359,7 @@ void register_console(struct console *newcon)
1363 spin_unlock_irqrestore(&logbuf_lock, flags); 1359 spin_unlock_irqrestore(&logbuf_lock, flags);
1364 } 1360 }
1365 release_console_sem(); 1361 release_console_sem();
1362 console_sysfs_notify();
1366 1363
1367 /* 1364 /*
1368 * By unregistering the bootconsoles after we enable the real console 1365 * By unregistering the bootconsoles after we enable the real console
@@ -1421,6 +1418,7 @@ int unregister_console(struct console *console)
1421 console_drivers->flags |= CON_CONSDEV; 1418 console_drivers->flags |= CON_CONSDEV;
1422 1419
1423 release_console_sem(); 1420 release_console_sem();
1421 console_sysfs_notify();
1424 return res; 1422 return res;
1425} 1423}
1426EXPORT_SYMBOL(unregister_console); 1424EXPORT_SYMBOL(unregister_console);