diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2010-04-03 14:34:56 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-05-19 03:36:48 -0400 |
commit | b2be05273a1744d175bf4b67f6665637bb9ac7a8 (patch) | |
tree | c0b6333fbc7a1834bfc0eec86dd204b1daacf1b4 /kernel | |
parent | 8954da1f82a468deeeae3683252b5440e7f4ccbe (diff) |
panic: Allow warnings to set different taint flags
WARN() is used in some places to report firmware or hardware bugs that
are then worked-around. These bugs do not affect the stability of the
kernel and should not set the flag for TAINT_WARN. To allow for this,
add WARN_TAINT() and WARN_TAINT_ONCE() macros that take a taint number
as argument.
Architectures that implement warnings using trap instructions instead
of calls to warn_slowpath_*() now implement __WARN_TAINT(taint)
instead of __WARN().
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Acked-by: Helge Deller <deller@gmx.de>
Tested-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/panic.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/kernel/panic.c b/kernel/panic.c index 13d966b4c14a..8b821bce66e6 100644 --- a/kernel/panic.c +++ b/kernel/panic.c | |||
@@ -365,7 +365,8 @@ struct slowpath_args { | |||
365 | va_list args; | 365 | va_list args; |
366 | }; | 366 | }; |
367 | 367 | ||
368 | static void warn_slowpath_common(const char *file, int line, void *caller, struct slowpath_args *args) | 368 | static void warn_slowpath_common(const char *file, int line, void *caller, |
369 | unsigned taint, struct slowpath_args *args) | ||
369 | { | 370 | { |
370 | const char *board; | 371 | const char *board; |
371 | 372 | ||
@@ -381,7 +382,7 @@ static void warn_slowpath_common(const char *file, int line, void *caller, struc | |||
381 | print_modules(); | 382 | print_modules(); |
382 | dump_stack(); | 383 | dump_stack(); |
383 | print_oops_end_marker(); | 384 | print_oops_end_marker(); |
384 | add_taint(TAINT_WARN); | 385 | add_taint(taint); |
385 | } | 386 | } |
386 | 387 | ||
387 | void warn_slowpath_fmt(const char *file, int line, const char *fmt, ...) | 388 | void warn_slowpath_fmt(const char *file, int line, const char *fmt, ...) |
@@ -390,14 +391,29 @@ void warn_slowpath_fmt(const char *file, int line, const char *fmt, ...) | |||
390 | 391 | ||
391 | args.fmt = fmt; | 392 | args.fmt = fmt; |
392 | va_start(args.args, fmt); | 393 | va_start(args.args, fmt); |
393 | warn_slowpath_common(file, line, __builtin_return_address(0), &args); | 394 | warn_slowpath_common(file, line, __builtin_return_address(0), |
395 | TAINT_WARN, &args); | ||
394 | va_end(args.args); | 396 | va_end(args.args); |
395 | } | 397 | } |
396 | EXPORT_SYMBOL(warn_slowpath_fmt); | 398 | EXPORT_SYMBOL(warn_slowpath_fmt); |
397 | 399 | ||
400 | void warn_slowpath_fmt_taint(const char *file, int line, | ||
401 | unsigned taint, const char *fmt, ...) | ||
402 | { | ||
403 | struct slowpath_args args; | ||
404 | |||
405 | args.fmt = fmt; | ||
406 | va_start(args.args, fmt); | ||
407 | warn_slowpath_common(file, line, __builtin_return_address(0), | ||
408 | taint, &args); | ||
409 | va_end(args.args); | ||
410 | } | ||
411 | EXPORT_SYMBOL(warn_slowpath_fmt_taint); | ||
412 | |||
398 | void warn_slowpath_null(const char *file, int line) | 413 | void warn_slowpath_null(const char *file, int line) |
399 | { | 414 | { |
400 | warn_slowpath_common(file, line, __builtin_return_address(0), NULL); | 415 | warn_slowpath_common(file, line, __builtin_return_address(0), |
416 | TAINT_WARN, NULL); | ||
401 | } | 417 | } |
402 | EXPORT_SYMBOL(warn_slowpath_null); | 418 | EXPORT_SYMBOL(warn_slowpath_null); |
403 | #endif | 419 | #endif |