diff options
Diffstat (limited to 'kernel/panic.c')
-rw-r--r-- | kernel/panic.c | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/kernel/panic.c b/kernel/panic.c index 057540b6eee9..47e8ebccc22b 100644 --- a/kernel/panic.c +++ b/kernel/panic.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/debug_locks.h> | 12 | #include <linux/debug_locks.h> |
13 | #include <linux/sched/debug.h> | 13 | #include <linux/sched/debug.h> |
14 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
15 | #include <linux/kgdb.h> | ||
15 | #include <linux/kmsg_dump.h> | 16 | #include <linux/kmsg_dump.h> |
16 | #include <linux/kallsyms.h> | 17 | #include <linux/kallsyms.h> |
17 | #include <linux/notifier.h> | 18 | #include <linux/notifier.h> |
@@ -220,6 +221,13 @@ void panic(const char *fmt, ...) | |||
220 | #endif | 221 | #endif |
221 | 222 | ||
222 | /* | 223 | /* |
224 | * If kgdb is enabled, give it a chance to run before we stop all | ||
225 | * the other CPUs or else we won't be able to debug processes left | ||
226 | * running on them. | ||
227 | */ | ||
228 | kgdb_panic(buf); | ||
229 | |||
230 | /* | ||
223 | * If we have crashed and we have a crash kernel loaded let it handle | 231 | * If we have crashed and we have a crash kernel loaded let it handle |
224 | * everything else. | 232 | * everything else. |
225 | * If we want to run this after calling panic_notifiers, pass | 233 | * If we want to run this after calling panic_notifiers, pass |
@@ -551,9 +559,6 @@ void __warn(const char *file, int line, void *caller, unsigned taint, | |||
551 | { | 559 | { |
552 | disable_trace_on_warning(); | 560 | disable_trace_on_warning(); |
553 | 561 | ||
554 | if (args) | ||
555 | pr_warn(CUT_HERE); | ||
556 | |||
557 | if (file) | 562 | if (file) |
558 | pr_warn("WARNING: CPU: %d PID: %d at %s:%d %pS\n", | 563 | pr_warn("WARNING: CPU: %d PID: %d at %s:%d %pS\n", |
559 | raw_smp_processor_id(), current->pid, file, line, | 564 | raw_smp_processor_id(), current->pid, file, line, |
@@ -591,37 +596,26 @@ void __warn(const char *file, int line, void *caller, unsigned taint, | |||
591 | add_taint(taint, LOCKDEP_STILL_OK); | 596 | add_taint(taint, LOCKDEP_STILL_OK); |
592 | } | 597 | } |
593 | 598 | ||
594 | #ifdef WANT_WARN_ON_SLOWPATH | 599 | #ifndef __WARN_FLAGS |
595 | void warn_slowpath_fmt(const char *file, int line, const char *fmt, ...) | 600 | void warn_slowpath_fmt(const char *file, int line, unsigned taint, |
601 | const char *fmt, ...) | ||
596 | { | 602 | { |
597 | struct warn_args args; | 603 | struct warn_args args; |
598 | 604 | ||
599 | args.fmt = fmt; | 605 | pr_warn(CUT_HERE); |
600 | va_start(args.args, fmt); | ||
601 | __warn(file, line, __builtin_return_address(0), TAINT_WARN, NULL, | ||
602 | &args); | ||
603 | va_end(args.args); | ||
604 | } | ||
605 | EXPORT_SYMBOL(warn_slowpath_fmt); | ||
606 | 606 | ||
607 | void warn_slowpath_fmt_taint(const char *file, int line, | 607 | if (!fmt) { |
608 | unsigned taint, const char *fmt, ...) | 608 | __warn(file, line, __builtin_return_address(0), taint, |
609 | { | 609 | NULL, NULL); |
610 | struct warn_args args; | 610 | return; |
611 | } | ||
611 | 612 | ||
612 | args.fmt = fmt; | 613 | args.fmt = fmt; |
613 | va_start(args.args, fmt); | 614 | va_start(args.args, fmt); |
614 | __warn(file, line, __builtin_return_address(0), taint, NULL, &args); | 615 | __warn(file, line, __builtin_return_address(0), taint, NULL, &args); |
615 | va_end(args.args); | 616 | va_end(args.args); |
616 | } | 617 | } |
617 | EXPORT_SYMBOL(warn_slowpath_fmt_taint); | 618 | EXPORT_SYMBOL(warn_slowpath_fmt); |
618 | |||
619 | void warn_slowpath_null(const char *file, int line) | ||
620 | { | ||
621 | pr_warn(CUT_HERE); | ||
622 | __warn(file, line, __builtin_return_address(0), TAINT_WARN, NULL, NULL); | ||
623 | } | ||
624 | EXPORT_SYMBOL(warn_slowpath_null); | ||
625 | #else | 619 | #else |
626 | void __warn_printk(const char *fmt, ...) | 620 | void __warn_printk(const char *fmt, ...) |
627 | { | 621 | { |