Re: found strange bug in 2.x --fixed

ranger (ranger@queen.it)
Thu, 19 Mar 1998 11:21:38 +0100 (CET)


I have found the problem: probably a BIOS bug. If I force a keyboard reset
(disabled for i386) it works fine.
I fixed the problem adding a command line option "kbd-reset" that force a
keyboard reset.

diff -urN linux-2.1.89.orig/drivers/char/pc_keyb.c linux-2.1.89.dist/drivers/char/pc_keyb.c
--- linux-2.1.89.orig/drivers/char/pc_keyb.c Thu Dec 18 00:23:47 1997
+++ linux-2.1.89.dist/drivers/char/pc_keyb.c Thu Mar 19 10:32:45 1998
@@ -23,6 +23,7 @@
#include <asm/bitops.h>
#include <asm/io.h>
#include <asm/system.h>
+#include <asm/irq.h>

/* Some configuration switches are present in the include file... */

@@ -47,15 +48,21 @@
* them.
*/

-#ifndef __i386__
-#define INIT_KBD
+/*
+ * Some x86 BIOSes do not correctly initializes the keyboard, so the
+ * "kbd-reset" command line options can be given to force a reset.
+ * [Ranger]
+ */
+#ifdef __i386__
+ int kbd_startup_reset __initdata = 0;
+#else
+ int kbd_startup_reset __initdata = 1;
#endif

-#ifdef INIT_KBD
+

__initfunc(static int kbd_wait_for_input(void))
{
- int n;
int status, data;
unsigned long start = jiffies;

@@ -185,7 +192,7 @@
printk(KERN_WARNING "initialize_kbd: %s\n", msg);
}

-#endif /* INIT_KBD */
+

unsigned char kbd_read_mask = KBD_STAT_OBF; /* Modified by psaux.c */

@@ -585,7 +592,14 @@
{
request_irq(KEYBOARD_IRQ, keyboard_interrupt, 0, "keyboard", NULL);
request_region(0x60, 16, "keyboard");
-#ifdef INIT_KBD
- initialize_kbd();
-#endif
+
+ if (kbd_startup_reset) initialize_kbd();
+
+}
+
+/* for "kbd-reset" cmdline param */
+__initfunc(void kbd_reset_setup(char *str, int *ints))
+{
+ kbd_startup_reset = 1;
}
+
diff -urN linux-2.1.89.orig/init/main.c linux-2.1.89.dist/init/main.c
--- linux-2.1.89.orig/init/main.c Tue Feb 10 01:12:56 1998
+++ linux-2.1.89.dist/init/main.c Thu Mar 19 01:45:50 1998
@@ -78,6 +78,7 @@
extern void smp_setup(char *str, int *ints);
extern void ioapic_pirq_setup(char *str, int *ints);
extern void no_scroll(char *str, int *ints);
+extern void kbd_reset_setup(char *str, int *ints);
extern void swap_setup(char *str, int *ints);
extern void buff_setup(char *str, int *ints);
extern void panic_setup(char *str, int *ints);
@@ -496,6 +497,7 @@
{ "console=", console_setup },
#ifdef CONFIG_VT
{ "no-scroll", no_scroll },
+ { "kbd-reset", kbd_reset_setup },
#endif
#ifdef CONFIG_BUGi386
{ "no-hlt", no_halt },

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu