Merge branch 'master' into next
[linux-2.6.git] / kernel / printk.c
index 0cecba0..f64b899 100644 (file)
 #include <asm/uaccess.h>
 
 /*
- * for_each_console() allows you to iterate on each console
- */
-#define for_each_console(con) \
-       for (con = console_drivers; con != NULL; con = con->next)
-
-/*
  * Architectures can override it:
  */
 void asmlinkage __attribute__((weak)) early_printk(const char *fmt, ...)
@@ -1080,21 +1074,23 @@ static DEFINE_PER_CPU(int, printk_pending);
 
 void printk_tick(void)
 {
-       if (__get_cpu_var(printk_pending)) {
-               __get_cpu_var(printk_pending) = 0;
+       if (__this_cpu_read(printk_pending)) {
+               __this_cpu_write(printk_pending, 0);
                wake_up_interruptible(&log_wait);
        }
 }
 
 int printk_needs_cpu(int cpu)
 {
-       return per_cpu(printk_pending, cpu);
+       if (cpu_is_offline(cpu))
+               printk_tick();
+       return __this_cpu_read(printk_pending);
 }
 
 void wake_up_klogd(void)
 {
        if (waitqueue_active(&log_wait))
-               __raw_get_cpu_var(printk_pending) = 1;
+               this_cpu_write(printk_pending, 1);
 }
 
 /**
@@ -1363,6 +1359,7 @@ void register_console(struct console *newcon)
                spin_unlock_irqrestore(&logbuf_lock, flags);
        }
        release_console_sem();
+       console_sysfs_notify();
 
        /*
         * By unregistering the bootconsoles after we enable the real console
@@ -1421,6 +1418,7 @@ int unregister_console(struct console *console)
                console_drivers->flags |= CON_CONSDEV;
 
        release_console_sem();
+       console_sysfs_notify();
        return res;
 }
 EXPORT_SYMBOL(unregister_console);