Merge branch 'asoc-5.4' into asoc-5.5
[linux-2.6-microblaze.git] / kernel / panic.c
index 057540b..47e8ebc 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/debug_locks.h>
 #include <linux/sched/debug.h>
 #include <linux/interrupt.h>
+#include <linux/kgdb.h>
 #include <linux/kmsg_dump.h>
 #include <linux/kallsyms.h>
 #include <linux/notifier.h>
@@ -219,6 +220,13 @@ void panic(const char *fmt, ...)
                dump_stack();
 #endif
 
+       /*
+        * If kgdb is enabled, give it a chance to run before we stop all
+        * the other CPUs or else we won't be able to debug processes left
+        * running on them.
+        */
+       kgdb_panic(buf);
+
        /*
         * If we have crashed and we have a crash kernel loaded let it handle
         * everything else.
@@ -551,9 +559,6 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
 {
        disable_trace_on_warning();
 
-       if (args)
-               pr_warn(CUT_HERE);
-
        if (file)
                pr_warn("WARNING: CPU: %d PID: %d at %s:%d %pS\n",
                        raw_smp_processor_id(), current->pid, file, line,
@@ -591,37 +596,26 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
        add_taint(taint, LOCKDEP_STILL_OK);
 }
 
-#ifdef WANT_WARN_ON_SLOWPATH
-void warn_slowpath_fmt(const char *file, int line, const char *fmt, ...)
+#ifndef __WARN_FLAGS
+void warn_slowpath_fmt(const char *file, int line, unsigned taint,
+                      const char *fmt, ...)
 {
        struct warn_args args;
 
-       args.fmt = fmt;
-       va_start(args.args, fmt);
-       __warn(file, line, __builtin_return_address(0), TAINT_WARN, NULL,
-              &args);
-       va_end(args.args);
-}
-EXPORT_SYMBOL(warn_slowpath_fmt);
+       pr_warn(CUT_HERE);
 
-void warn_slowpath_fmt_taint(const char *file, int line,
-                            unsigned taint, const char *fmt, ...)
-{
-       struct warn_args args;
+       if (!fmt) {
+               __warn(file, line, __builtin_return_address(0), taint,
+                      NULL, NULL);
+               return;
+       }
 
        args.fmt = fmt;
        va_start(args.args, fmt);
        __warn(file, line, __builtin_return_address(0), taint, NULL, &args);
        va_end(args.args);
 }
-EXPORT_SYMBOL(warn_slowpath_fmt_taint);
-
-void warn_slowpath_null(const char *file, int line)
-{
-       pr_warn(CUT_HERE);
-       __warn(file, line, __builtin_return_address(0), TAINT_WARN, NULL, NULL);
-}
-EXPORT_SYMBOL(warn_slowpath_null);
+EXPORT_SYMBOL(warn_slowpath_fmt);
 #else
 void __warn_printk(const char *fmt, ...)
 {