Commit bd89bb29a01503c5cffa367eccb0b356f910cb8d
Committed by
Ingo Molnar
1 parent
74853dba2f
Exists in
master
and in
4 other branches
debug warnings: print the DMI board info name in a WARN/WARN_ON
Impact: extend WARN_ON() output with DMI_PRODUCT_NAME It's very useful for many low level WARN_ON's to find out which motherboard has the broken BIOS etc... this patch adds a printk to the WARN_ON code for this. On architectures without DMI, gcc should optimize the code out. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Showing 1 changed file with 6 additions and 0 deletions Side-by-side Diff
kernel/panic.c
... | ... | @@ -21,6 +21,7 @@ |
21 | 21 | #include <linux/debug_locks.h> |
22 | 22 | #include <linux/random.h> |
23 | 23 | #include <linux/kallsyms.h> |
24 | +#include <linux/dmi.h> | |
24 | 25 | |
25 | 26 | int panic_on_oops; |
26 | 27 | static unsigned long tainted_mask; |
27 | 28 | |
... | ... | @@ -325,11 +326,16 @@ |
325 | 326 | va_list args; |
326 | 327 | char function[KSYM_SYMBOL_LEN]; |
327 | 328 | unsigned long caller = (unsigned long)__builtin_return_address(0); |
329 | + const char *board; | |
330 | + | |
328 | 331 | sprint_symbol(function, caller); |
329 | 332 | |
330 | 333 | printk(KERN_WARNING "------------[ cut here ]------------\n"); |
331 | 334 | printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file, |
332 | 335 | line, function); |
336 | + board = dmi_get_system_info(DMI_PRODUCT_NAME); | |
337 | + if (board) | |
338 | + printk(KERN_WARNING "Hardware name: %s\n", board); | |
333 | 339 | |
334 | 340 | if (fmt) { |
335 | 341 | va_start(args, fmt); |