Skip to contentSkip to conversation

dead keyboard in lk 2.5.25

PATCH Douglas Gilbert 3 participants 3 messages Jul 7, 2002 Input drivers

lore
Share & tools
lore
#0 lore raw

When I first booted lk 2.5.25 on an Athlon box the AT keyboard was inactive. The mouse worked and the box was accessible across the network so it looked like a problem with the keyboard or its driver.

/var/log/messages contained this sequence:

Jul  6 09:57:00 frig kernel: mice: PS/2 mouse device common for all mice
Jul  6 09:57:00 frig kernel: spurious 8259A interrupt: IRQ7.
Jul  6 09:57:00 frig kernel: i8042.c: Can't get irq 1 for KBD
Jul  6 09:57:00 frig kernel: i8042.c: Can't get irq 1 for KBD
Jul  6 09:57:00 frig kernel: serio: i8042 KBD port at 0x60,0x64 irq 1
Jul  6 09:57:00 frig kernel: input.c: hotplug returned -2

and /proc/interrupts indicated that irq 1 was owned by "keyboard" which implied drivers/char/pc_keyb.c owned the keyboard. The attempt by "i8042" to claim irq 1 returned -EBUSY which caused the "can't get irq 1" line above.

Since nobody else has reported this error it could be local to my environment. If you get this problem, the crude patch below fixed it for me.

Doug Gilbert

drivers/input/serio/i8042.c2525fix renamed from drivers/input/serio/i8042.c +5 -2
@@ -269,8 +269,11 @@
  */
 
 	if (request_irq(values->irq, i8042_interrupt, 0, "i8042", NULL)) {
-		printk(KERN_ERR "i8042.c: Can't get irq %d for %s\n", values->irq, values->name);
-		return -1;
+		free_irq(values->irq, NULL);
+		if (request_irq(values->irq, i8042_interrupt, 0, "i8042", NULL)) {
+			printk(KERN_ERR "i8042.c: Can't get irq %d for %s\n", values->irq, values->name);
+			return -1;
+		}
 	}
 
 /*
#1 lore raw
Quoted 6 lines · Douglas Gilbert
drivers/input/serio/i8042.c2525fix renamed from drivers/input/serio/i8042.c +0 -0
@@ -269,8 +269,11 @@
  */
 
 	if (request_irq(values->irq, i8042_interrupt, 0, "i8042", NULL)) {

drivers/input/serio/i8042.c2525fix line 279

Quoted 10 lines
drivers/input/serio/i8042.c2525fix renamed from drivers/input/serio/i8042.c +5 -2
-		printk(KERN_ERR "i8042.c: Can't get irq %d for %s\n", values->irq, values->name);
-		return -1;
+		free_irq(values->irq, NULL);
+		if (request_irq(values->irq, i8042_interrupt, 0, "i8042", NULL)) {
+			printk(KERN_ERR "i8042.c: Can't get irq %d for %s\n", values->irq, values->name);
+			return -1;
+		}
 	}
 
 /*

Hmm, interesting concept. "If someone else is using my resource, I'll free it for them, and re-claim it". It sounds very much like a hack rather than a fix to me.

I'd guess the real solution would be to stop pc_keyb being initialised when you're trying to use i8042.c. Vojtech?

Signature · 2 lines
Russell King ([email protected])                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html
#2 lore raw
Quoted 16 lines · Russell King
Quoted 15 lines · Douglas Gilbert
drivers/input/serio/i8042.c2525fix renamed from drivers/input/serio/i8042.c +5 -2
@@ -269,8 +269,11 @@
  */
 
 	if (request_irq(values->irq, i8042_interrupt, 0, "i8042", NULL)) {
-		printk(KERN_ERR "i8042.c: Can't get irq %d for %s\n", values->irq, values->name);
-		return -1;
+		free_irq(values->irq, NULL);
+		if (request_irq(values->irq, i8042_interrupt, 0, "i8042", NULL)) {
+			printk(KERN_ERR "i8042.c: Can't get irq %d for %s\n", values->irq, values->name);
+			return -1;
+		}
 	}
 
Quoted 8 lines

drivers/input/serio/i8042.c2525fix line 279

Quoted 1 line
drivers/input/serio/i8042.c2525fix renamed from drivers/input/serio/i8042.c +0 -0
 /*

Hmm, interesting concept. "If someone else is using my resource, I'll free it for them, and re-claim it". It sounds very much like a hack rather than a fix to me.

I'd guess the real solution would be to stop pc_keyb being initialised when you're trying to use i8042.c. Vojtech?

The real solution is to delete pc_keyb.c. But that'll take some time yet. i8042.c is there so that the build problems, and other obvious stuff gets fixed. Later we can start actually using it.

Signature · 2 lines
Vojtech Pavlik
SuSE Labs