Merge tag 'printk-for-4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 14 Sep 2018 05:37:08 +0000 (19:37 -1000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 14 Sep 2018 05:37:08 +0000 (19:37 -1000)
Pull printk fix from Petr Mladek:
 "Revert a commit that caused "quiet", "debug", and "loglevel" early
  parameters to be ignored for early boot messages"

* tag 'printk-for-4.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk:
  Revert "printk: make sure to print log on console."

1  2 
kernel/printk/printk.c

diff --combined kernel/printk/printk.c
index fd6f8ed28e010a0808c8e67a698372ce5fc411da,e30e5023511b076fddc8e579c1074efde17fcaf5..9bf5404397e0b224873456617437fc172617a637
@@@ -38,6 -38,7 +38,6 @@@
  #include <linux/kmsg_dump.h>
  #include <linux/syslog.h>
  #include <linux/cpu.h>
 -#include <linux/notifier.h>
  #include <linux/rculist.h>
  #include <linux/poll.h>
  #include <linux/irq_work.h>
@@@ -65,9 -66,6 +65,9 @@@ int console_printk[4] = 
        CONSOLE_LOGLEVEL_DEFAULT,       /* default_console_loglevel */
  };
  
 +atomic_t ignore_console_lock_warning __read_mostly = ATOMIC_INIT(0);
 +EXPORT_SYMBOL(ignore_console_lock_warning);
 +
  /*
   * Low level drivers may need that to know if they can schedule in
   * their unblank() callback or not. So let's export it.
@@@ -351,7 -349,6 +351,6 @@@ static int console_msg_format = MSG_FOR
   */
  
  enum log_flags {
-       LOG_NOCONS      = 1,    /* suppress print, do not print to console */
        LOG_NEWLINE     = 2,    /* text ended with a newline */
        LOG_PREFIX      = 4,    /* text started with a prefix */
        LOG_CONT        = 8,    /* text is a fragment of a continuation line */
@@@ -1881,9 -1878,6 +1880,6 @@@ int vprintk_store(int facility, int lev
        if (dict)
                lflags |= LOG_PREFIX|LOG_NEWLINE;
  
-       if (suppress_message_printing(level))
-               lflags |= LOG_NOCONS;
        return log_output(facility, level, lflags,
                          dict, dictlen, text, text_len);
  }
@@@ -2032,6 -2026,7 +2028,7 @@@ static void call_console_drivers(const 
                                 const char *text, size_t len) {}
  static size_t msg_print_text(const struct printk_log *msg,
                             bool syslog, char *buf, size_t size) { return 0; }
+ static bool suppress_message_printing(int level) { return false; }
  
  #endif /* CONFIG_PRINTK */
  
@@@ -2261,7 -2256,6 +2258,7 @@@ int is_console_locked(void
  {
        return console_locked;
  }
 +EXPORT_SYMBOL(is_console_locked);
  
  /*
   * Check if we have any console that is capable of printing while cpu is
@@@ -2368,10 -2362,11 +2365,11 @@@ skip
                        break;
  
                msg = log_from_idx(console_idx);
-               if (msg->flags & LOG_NOCONS) {
+               if (suppress_message_printing(msg->level)) {
                        /*
-                        * Skip record if !ignore_loglevel, and
-                        * record has level above the console loglevel.
+                        * Skip record we have buffered and already printed
+                        * directly to the console when we received it, and
+                        * record that has level above the console loglevel.
                         */
                        console_idx = log_next(console_idx);
                        console_seq++;
@@@ -2790,8 -2785,7 +2788,8 @@@ EXPORT_SYMBOL(unregister_console)
  void __init console_init(void)
  {
        int ret;
 -      initcall_t *call;
 +      initcall_t call;
 +      initcall_entry_t *ce;
  
        /* Setup the default TTY line discipline. */
        n_tty_init();
         * set up the console device so that later boot sequences can
         * inform about problems etc..
         */
 -      call = __con_initcall_start;
 +      ce = __con_initcall_start;
        trace_initcall_level("console");
 -      while (call < __con_initcall_end) {
 -              trace_initcall_start((*call));
 -              ret = (*call)();
 -              trace_initcall_finish((*call), ret);
 -              call++;
 +      while (ce < __con_initcall_end) {
 +              call = initcall_from_entry(ce);
 +              trace_initcall_start(call);
 +              ret = call();
 +              trace_initcall_finish(call, ret);
 +              ce++;
        }
  }