2002-12-04 20:50:24

by Randy.Dunlap

[permalink] [raw]
Subject: [PATCH] Re: pc_keyb.c #define kbd_controller_present()


Hi,

Nat Ersoz wrote a couple of weeks back about systems that he has
without PS/2 (or AT) keyboards attached, and he mentioned a possible
solution. I have done a minimal implementation of that solution
for 2.4.20. Nat has tested it on a system with an IR keyboard and is
ready to ship it. :) I have tested it on a system with a USB
keyboard. Both of these systems have a PS/2 keyboard controller
on them but no PS/2 keyboard attached.

I know that 2.5 has a different solution for this, but this is
now available for 2.4 for anyone who needs it.
This introduces CONFIG_PSKEYBOARD for i386, which defaults to Yes/ON,
so you'll need to disablel this option to use/test it, and it's
marked Experimental, so you'll need to enable Experimental also.

This eliminates some keyboard timeouts and messages such as:
| keyboard: Timeout - AT keyboard not present?(ed)
| keyboard: Timeout - AT keyboard not present?(f4)
| "pc_keyb: controller jammed 0xFF"
and it makes booting faster on systems that were experiencing
such keyboard timeouts.

Comments?

--
~Randy


On 4 Dec 2002, Nat Ersoz wrote:

| That worked for me. Thanks for taking the initiative on this! I used it
| to patch both the 2.4.19 and 2.4.20 kernels without errors. This looks
| good to me. Ship it!
|
| Nat



Attachments:
kbc_option_2420.patch (2.21 kB)

2002-12-09 21:26:44

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH] Re: pc_keyb.c #define kbd_controller_present()

You should only need this:

+#ifndef CONFIG_PSKEYBOARD
+#define kbd_controller_present() 0
+#endif

I think the following hunk should be superfluous:

+#ifdef CONFIG_PSKEYBOARD
#define kbd_read_input() inb(KBD_DATA_REG)
#define kbd_read_status() inb(KBD_STATUS_REG)
#define kbd_write_output(val) outb(val, KBD_DATA_REG)
#define kbd_write_command(val) outb(val, KBD_CNTL_REG)
+#else
+#define kbd_read_input() 0
+#define kbd_read_status() 0
+#define kbd_write_output(val)
+#define kbd_write_command(val)
+#endif

Or is there some case where pc_keyb will use kbd_read_input() and
friends even if kbd_controller_present() is false?

We have the equivalent of the first hunk in asm-ia64/keyboard.h, and
the kbd_controller_present() hook should be used consistently to
avoid breakage. For example, if you include the second hunk, and
pc_keyb.c changes to use kbd_read_input() even when kbd_controller_present()
is false, i386 might still work but ia64 would break.

Bjorn