Skip to content

Commit

Permalink
dmi: log board, system, and BIOS information
Browse files Browse the repository at this point in the history
Put basic system information in the dmesg log.  There are lots of dmesg
logs on the web, and it would be useful if they contained this information
for debugging platform problems.  "BOARD/PRODUCT" format copied from
show_regs_common(), which is used in the oops path.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Bjorn Helgaas authored and Linus Torvalds committed Oct 28, 2010
1 parent d31eb51 commit 8881cdc
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion drivers/firmware/dmi_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <linux/string.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/ctype.h>
#include <linux/dmi.h>
#include <linux/efi.h>
#include <linux/bootmem.h>
Expand Down Expand Up @@ -361,6 +362,33 @@ static void __init dmi_decode(const struct dmi_header *dm, void *dummy)
}
}

static void __init print_filtered(const char *info)
{
const char *p;

if (!info)
return;

for (p = info; *p; p++)
if (isprint(*p))
printk(KERN_CONT "%c", *p);
else
printk(KERN_CONT "\\x%02x", *p & 0xff);
}

static void __init dmi_dump_ids(void)
{
printk(KERN_DEBUG "DMI: ");
print_filtered(dmi_get_system_info(DMI_BOARD_NAME));
printk(KERN_CONT "/");
print_filtered(dmi_get_system_info(DMI_PRODUCT_NAME));
printk(KERN_CONT ", BIOS ");
print_filtered(dmi_get_system_info(DMI_BIOS_VERSION));
printk(KERN_CONT " ");
print_filtered(dmi_get_system_info(DMI_BIOS_DATE));
printk(KERN_CONT "\n");
}

static int __init dmi_present(const char __iomem *p)
{
u8 buf[15];
Expand All @@ -381,8 +409,10 @@ static int __init dmi_present(const char __iomem *p)
buf[14] >> 4, buf[14] & 0xF);
else
printk(KERN_INFO "DMI present.\n");
if (dmi_walk_early(dmi_decode) == 0)
if (dmi_walk_early(dmi_decode) == 0) {
dmi_dump_ids();
return 0;
}
}
return 1;
}
Expand Down

0 comments on commit 8881cdc

Please sign in to comment.