tizen: Use unique directory prefix for baselibs packages
[platform/kernel/linux-rpi.git] / kernel / panic.c
index ffa037f..9215df2 100644 (file)
@@ -366,6 +366,8 @@ void panic(const char *fmt, ...)
         */
        atomic_notifier_call_chain(&panic_notifier_list, 0, buf);
 
+       printk_legacy_allow_panic_sync();
+
        panic_print_sys_info(false);
 
        kmsg_dump(KMSG_DUMP_PANIC);
@@ -442,6 +444,15 @@ void panic(const char *fmt, ...)
 
        /* Do not scroll important messages printed above */
        suppress_printk = 1;
+
+       /*
+        * The final messages may not have been printed if in a context that
+        * defers printing (such as NMI) and irq_work is not available.
+        * Explicitly flush the kernel log buffer one last time.
+        */
+       console_flush_on_panic(CONSOLE_FLUSH_PENDING);
+       nbcon_atomic_flush_unsafe();
+
        local_irq_enable();
        for (i = 0; ; i += PANIC_TIMER_STEP) {
                touch_softlockup_watchdog();
@@ -619,6 +630,7 @@ bool oops_may_print(void)
  */
 void oops_enter(void)
 {
+       nbcon_cpu_emergency_enter();
        tracing_off();
        /* can't trust the integrity of the kernel anymore: */
        debug_locks_off();
@@ -641,6 +653,7 @@ void oops_exit(void)
 {
        do_oops_enter_exit();
        print_oops_end_marker();
+       nbcon_cpu_emergency_exit();
        kmsg_dump(KMSG_DUMP_OOPS);
 }
 
@@ -652,6 +665,8 @@ struct warn_args {
 void __warn(const char *file, int line, void *caller, unsigned taint,
            struct pt_regs *regs, struct warn_args *args)
 {
+       nbcon_cpu_emergency_enter();
+
        disable_trace_on_warning();
 
        if (file)
@@ -682,6 +697,8 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
 
        /* Just a warning, don't kill lockdep. */
        add_taint(taint, LOCKDEP_STILL_OK);
+
+       nbcon_cpu_emergency_exit();
 }
 
 #ifdef CONFIG_BUG