Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86, dmi, debug: Log board name (when present) in dmesg/oops output

The "Type 2" SMBIOS record that contains Board Name is not
strictly required and may be absent in the SMBIOS on some
platforms.

( Please note that Type 2 is not listed in Table 3 in Sec 6.2
("Required Structures and Data") of the SMBIOS v2.7
Specification. )

Use the Manufacturer Name (aka System Vendor) name.
Print Board Name only when it is present.

Before the fix:
(i) dmesg output: DMI: /ProLiant DL380 G6, BIOS P62 01/29/2011
(ii) oops output: Pid: 2170, comm: bash Not tainted 2.6.38-rc4+ #3 /ProLiant DL380 G6

After the fix:
(i) dmesg output: DMI: HP ProLiant DL380 G6, BIOS P62 01/29/2011
(ii) oops output: Pid: 2278, comm: bash Not tainted 2.6.38-rc4+ #4 HP ProLiant DL380 G6

Signed-off-by: Naga Chumbalkar <nagananda.chumbalkar@hp.com>
Reviewed-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: <stable@kernel.org> # .3x - good for debugging, please apply as far back as it applies cleanly
LKML-Reference: <20110214224423.2182.13929.sendpatchset@nchumbalkar.americas.hpqcorp.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by

Naga Chumbalkar and committed by
Ingo Molnar
84e383b3 678301ec

+25 -8
+16 -6
arch/x86/kernel/process.c
··· 92 92 93 93 void show_regs_common(void) 94 94 { 95 - const char *board, *product; 95 + const char *vendor, *product, *board; 96 96 97 - board = dmi_get_system_info(DMI_BOARD_NAME); 98 - if (!board) 99 - board = ""; 97 + vendor = dmi_get_system_info(DMI_SYS_VENDOR); 98 + if (!vendor) 99 + vendor = ""; 100 100 product = dmi_get_system_info(DMI_PRODUCT_NAME); 101 101 if (!product) 102 102 product = ""; 103 103 104 + /* Board Name is optional */ 105 + board = dmi_get_system_info(DMI_BOARD_NAME); 106 + 104 107 printk(KERN_CONT "\n"); 105 - printk(KERN_DEFAULT "Pid: %d, comm: %.20s %s %s %.*s %s/%s\n", 108 + printk(KERN_DEFAULT "Pid: %d, comm: %.20s %s %s %.*s", 106 109 current->pid, current->comm, print_tainted(), 107 110 init_utsname()->release, 108 111 (int)strcspn(init_utsname()->version, " "), 109 - init_utsname()->version, board, product); 112 + init_utsname()->version); 113 + printk(KERN_CONT " "); 114 + printk(KERN_CONT "%s %s", vendor, product); 115 + if (board) { 116 + printk(KERN_CONT "/"); 117 + printk(KERN_CONT "%s", board); 118 + } 119 + printk(KERN_CONT "\n"); 110 120 } 111 121 112 122 void flush_thread(void)
+9 -2
drivers/firmware/dmi_scan.c
··· 378 378 379 379 static void __init dmi_dump_ids(void) 380 380 { 381 + const char *board; /* Board Name is optional */ 382 + 381 383 printk(KERN_DEBUG "DMI: "); 382 - print_filtered(dmi_get_system_info(DMI_BOARD_NAME)); 383 - printk(KERN_CONT "/"); 384 + print_filtered(dmi_get_system_info(DMI_SYS_VENDOR)); 385 + printk(KERN_CONT " "); 384 386 print_filtered(dmi_get_system_info(DMI_PRODUCT_NAME)); 387 + board = dmi_get_system_info(DMI_BOARD_NAME); 388 + if (board) { 389 + printk(KERN_CONT "/"); 390 + print_filtered(board); 391 + } 385 392 printk(KERN_CONT ", BIOS "); 386 393 print_filtered(dmi_get_system_info(DMI_BIOS_VERSION)); 387 394 printk(KERN_CONT " ");