From: Corey Minyard <minyard@acm.org>
To: Andrew Morton <akpm@osdl.org>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH] Fix for handling bad IPMI ACPI data
Date: Mon, 25 Apr 2005 12:09:23 -0500 [thread overview]
Message-ID: <426D2443.3030403@acm.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: ipmi_broken_acpi_register_bits.diff --]
[-- Type: text/x-patch, Size: 1305 bytes --]
If the ACPI register bit width is zero (an invalid value) assume
it is the default spacing. This avoids some coredumps on invalid
data and makes some systems work that have broken ACPI data.
Signed-off-by: Corey Minyard <minyard@acm.org>
Index: linux-2.6.12-rc2/drivers/char/ipmi/ipmi_si_intf.c
===================================================================
--- linux-2.6.12-rc2.orig/drivers/char/ipmi/ipmi_si_intf.c
+++ linux-2.6.12-rc2/drivers/char/ipmi/ipmi_si_intf.c
@@ -1557,8 +1557,17 @@
info->irq_setup = NULL;
}
- regspacings[intf_num] = spmi->addr.register_bit_width / 8;
- info->io.regspacing = spmi->addr.register_bit_width / 8;
+ if (spmi->addr.register_bit_width) {
+ /* A (hopefully) properly formed register bit width. */
+ regspacings[intf_num] = spmi->addr.register_bit_width / 8;
+ info->io.regspacing = spmi->addr.register_bit_width / 8;
+ } else {
+ /* Some broken systems get this wrong and set the value
+ * to zero. Assume it is the default spacing. If that
+ * is wrong, too bad, the vendor should fix the tables. */
+ regspacings[intf_num] = DEFAULT_REGSPACING;
+ info->io.regspacing = DEFAULT_REGSPACING;
+ }
regsizes[intf_num] = regspacings[intf_num];
info->io.regsize = regsizes[intf_num];
regshifts[intf_num] = spmi->addr.register_bit_offset;
reply other threads:[~2005-04-25 17:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=426D2443.3030403@acm.org \
--to=minyard@acm.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.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