From: Keith Owens <kaos@sgi.com>
To: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org
Subject: Re: KDB blindly reads keyboard port
Date: Wed, 27 Sep 2006 02:45:50 +0000 [thread overview]
Message-ID: <5239.1159325150@kao2.melbourne.sgi.com> (raw)
In-Reply-To: Your message of "Tue, 26 Sep 2006 13:54:30 CST." <200609261354.30722.bjorn.helgaas@hp.com>
In-Reply-To: <200609261354.30722.bjorn.helgaas@hp.com>
Bjorn Helgaas (on Tue, 26 Sep 2006 13:54:30 -0600) wrote:
>get_kbd_char() in arch/ia64/kdb/kdba_io.c does "inb(KBD_STATUS_REG)".
>
>But we don't know whether there's even an i8042 keyboard controller
>present. On HP ia64 boxes, there is no i8042, and trying to read
>from it can cause an MCA.
>
>This depends on the specific platform and how it is configured. I
>observed this MCA while booting the SLES10 install kernel on an
>HP rx7620 in "default" acpiconfig mode. The supported acpiconfig
>mode on this box is "single-pci-domain", which also puts some
>legacy ports into "soft-fail" mode, where the read will just return
>0xff instead of causing an MCA. But I think it's wrong to blindly
>poke around in I/O port space.
No support for legacy I/O ports could be a bigger problem than just
KDB. To fix just KDB, apply this patch over kdb-v4.4-2.6.18-common-1 and add
'kdb_skip_keyboard' to the boot command line on the offending hardware.
---
arch/ia64/kdb/kdba_io.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
Index: linux/arch/ia64/kdb/kdba_io.c
=================================--- linux.orig/arch/ia64/kdb/kdba_io.c
+++ linux/arch/ia64/kdb/kdba_io.c
@@ -38,6 +38,7 @@
#else
#undef KDB_BLINK_LED
#endif
+static int kdb_skip_keyboard;
#ifdef CONFIG_KDB_USB
struct kdb_usb_exchange kdb_usb_infos;
@@ -334,7 +335,8 @@ static int get_kbd_char(void)
if (kbd_exists = 0)
return -1;
- if (inb(KBD_STATUS_REG) = 0xff && inb(KBD_DATA_REG) = 0xff) {
+ if (kdb_skip_keyboard ||
+ (inb(KBD_STATUS_REG) = 0xff && inb(KBD_DATA_REG) = 0xff)) {
kbd_exists = 0;
return -1;
}
@@ -561,3 +563,14 @@ get_char_func poll_funcs[] = {
void kdba_local_arch_setup(void) {}
void kdba_local_arch_cleanup(void) {}
+
+/* Some hardware gets an MCA instead of returning 0xff when we read
+ * KBD_STATUS_REG. If these systems boot a kernel with CONFIG_VT=y then they
+ * need to add 'kdb_skip_keyboard' to the boot line.
+ */
+static int __init kdb_skip_keyboard_setup(char * str)
+{
+ kdb_skip_keyboard = 1;
+ return 1;
+}
+__setup("kdb_skip_keyboard", kdb_skip_keyboard_setup);
WARNING: multiple messages have this Message-ID (diff)
From: Keith Owens <kaos@sgi.com>
To: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org
Subject: Re: KDB blindly reads keyboard port
Date: Wed, 27 Sep 2006 12:45:50 +1000 [thread overview]
Message-ID: <5239.1159325150@kao2.melbourne.sgi.com> (raw)
In-Reply-To: Your message of "Tue, 26 Sep 2006 13:54:30 CST." <200609261354.30722.bjorn.helgaas@hp.com>
Bjorn Helgaas (on Tue, 26 Sep 2006 13:54:30 -0600) wrote:
>get_kbd_char() in arch/ia64/kdb/kdba_io.c does "inb(KBD_STATUS_REG)".
>
>But we don't know whether there's even an i8042 keyboard controller
>present. On HP ia64 boxes, there is no i8042, and trying to read
>from it can cause an MCA.
>
>This depends on the specific platform and how it is configured. I
>observed this MCA while booting the SLES10 install kernel on an
>HP rx7620 in "default" acpiconfig mode. The supported acpiconfig
>mode on this box is "single-pci-domain", which also puts some
>legacy ports into "soft-fail" mode, where the read will just return
>0xff instead of causing an MCA. But I think it's wrong to blindly
>poke around in I/O port space.
No support for legacy I/O ports could be a bigger problem than just
KDB. To fix just KDB, apply this patch over kdb-v4.4-2.6.18-common-1 and add
'kdb_skip_keyboard' to the boot command line on the offending hardware.
---
arch/ia64/kdb/kdba_io.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
Index: linux/arch/ia64/kdb/kdba_io.c
===================================================================
--- linux.orig/arch/ia64/kdb/kdba_io.c
+++ linux/arch/ia64/kdb/kdba_io.c
@@ -38,6 +38,7 @@
#else
#undef KDB_BLINK_LED
#endif
+static int kdb_skip_keyboard;
#ifdef CONFIG_KDB_USB
struct kdb_usb_exchange kdb_usb_infos;
@@ -334,7 +335,8 @@ static int get_kbd_char(void)
if (kbd_exists == 0)
return -1;
- if (inb(KBD_STATUS_REG) == 0xff && inb(KBD_DATA_REG) == 0xff) {
+ if (kdb_skip_keyboard ||
+ (inb(KBD_STATUS_REG) == 0xff && inb(KBD_DATA_REG) == 0xff)) {
kbd_exists = 0;
return -1;
}
@@ -561,3 +563,14 @@ get_char_func poll_funcs[] = {
void kdba_local_arch_setup(void) {}
void kdba_local_arch_cleanup(void) {}
+
+/* Some hardware gets an MCA instead of returning 0xff when we read
+ * KBD_STATUS_REG. If these systems boot a kernel with CONFIG_VT=y then they
+ * need to add 'kdb_skip_keyboard' to the boot line.
+ */
+static int __init kdb_skip_keyboard_setup(char * str)
+{
+ kdb_skip_keyboard = 1;
+ return 1;
+}
+__setup("kdb_skip_keyboard", kdb_skip_keyboard_setup);
next prev parent reply other threads:[~2006-09-27 2:45 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-26 19:54 KDB blindly reads keyboard port Bjorn Helgaas
2006-09-26 19:54 ` Bjorn Helgaas
2006-09-27 2:45 ` Keith Owens [this message]
2006-09-27 2:45 ` Keith Owens
2006-09-27 11:57 ` Matthew Wilcox
2006-09-27 11:57 ` Matthew Wilcox
2006-09-27 22:11 ` Bjorn Helgaas
2006-09-27 22:11 ` Bjorn Helgaas
2006-09-29 2:18 ` Keith Owens
2006-09-29 2:18 ` Keith Owens
2006-09-29 16:57 ` Bjorn Helgaas
2006-09-29 16:57 ` Bjorn Helgaas
2006-09-29 18:01 ` Luck, Tony
2006-09-29 18:01 ` Luck, Tony
2006-09-29 18:58 ` Bjorn Helgaas
2006-09-29 18:58 ` Bjorn Helgaas
2006-11-10 4:23 ` Keith Owens
2006-11-10 4:23 ` Keith Owens
2006-11-10 4:28 ` Matthew Wilcox
2006-11-10 4:28 ` Matthew Wilcox
2006-11-10 6:15 ` Keith Owens
2006-11-10 6:15 ` Keith Owens
2006-11-16 4:02 ` Keith Owens
2006-11-16 4:02 ` Keith Owens
2006-11-16 16:28 ` Bjorn Helgaas
2006-11-16 16:28 ` 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=5239.1159325150@kao2.melbourne.sgi.com \
--to=kaos@sgi.com \
--cc=bjorn.helgaas@hp.com \
--cc=linux-ia64@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.