public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] DMI: log system, BIOS, and board information
Date: Wed, 29 Sep 2010 12:24:02 -0600	[thread overview]
Message-ID: <20100929182402.31093.4303.stgit@bob.kio> (raw)


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.

DMI often doesn't supply a board name, but I assume the others are pretty
standard.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
---

 drivers/firmware/dmi_scan.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)


diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index b3d22d6..ea6719f 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -364,6 +364,7 @@ static void __init dmi_decode(const struct dmi_header *dm, void *dummy)
 static int __init dmi_present(const char __iomem *p)
 {
 	u8 buf[15];
+	const char *board, *label = " board ";
 
 	memcpy_fromio(buf, p, 15);
 	if ((memcmp(buf, "_DMI_", 5) == 0) && dmi_checksum(buf)) {
@@ -381,8 +382,20 @@ 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) {
+			board = dmi_get_system_info(DMI_BOARD_NAME);
+			if (!board) {
+				board = "";
+				label = "";
+			}
+			printk(KERN_DEBUG "DMI: %s %s BIOS %s %s%s%s\n",
+			       dmi_get_system_info(DMI_SYS_VENDOR),
+			       dmi_get_system_info(DMI_PRODUCT_NAME),
+			       dmi_get_system_info(DMI_BIOS_VERSION),
+			       dmi_get_system_info(DMI_BIOS_DATE),
+			       label, board);
 			return 0;
+		}
 	}
 	return 1;
 }


             reply	other threads:[~2010-09-29 18:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-29 18:24 Bjorn Helgaas [this message]
2010-09-29 21:26 ` [PATCH] DMI: log system, BIOS, and board information Alan Cox
2010-09-29 21:35   ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100929182402.31093.4303.stgit@bob.kio \
    --to=bjorn.helgaas@hp.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox