Skip to contentSkip to conversation

2.6.9+ keyboard LED problem

DISCUSSION Meelis Roos 4 participants 8 messages Jan 5, 2005 – Jan 6, 2005

lore
Share & tools
lore
#0 lore raw

The input changes in 2.6.9 made keyboard LED setting unreliable. 2.6.8 is OK, 2.6.9, 2.6.10 and todays BK are buggy.

The problem is that setting the LEDs now interferes with keyboard and ps/2 mouse input and makes the kernel lose key press and key release events.

Short demonstation:
#!/bin/sh
while :; do xset led 3; xset -led 3; sleep 0.01; done

This script works from X but the same effect can be seen on the console using setleds. The problem was found with ledcontrol package but is easyly reproduced with the script above.

Key press and release events are lost, mouse movement is lost or movement is converted into clicks or mouse loses sync (by dmesg info). There are also messages like atkbd.c: Unknown key released (translated set 2, code 0xe0 on isa0060/serio0).
atkbd.c: Use 'setkeycodes e060 <keycode>' to make it known.
in dmesg.

Don't try the script without the sleep command unless you have a network connection to log in and kill the script ;)

Signature · 1 line
Meelis Roos ([email protected])
#1 lore raw
Quoted 23 lines · Meelis Roos

The input changes in 2.6.9 made keyboard LED setting unreliable. 2.6.8 is OK, 2.6.9, 2.6.10 and todays BK are buggy.

The problem is that setting the LEDs now interferes with keyboard and ps/2 mouse input and makes the kernel lose key press and key release events.

Short demonstation:
#!/bin/sh
while :; do xset led 3; xset -led 3; sleep 0.01; done

This script works from X but the same effect can be seen on the console using setleds. The problem was found with ledcontrol package but is easyly reproduced with the script above.

Key press and release events are lost, mouse movement is lost or movement is converted into clicks or mouse loses sync (by dmesg info). There are also messages like
atkbd.c: Unknown key released (translated set 2, code 0xe0 on isa0060/serio0). atkbd.c: Use 'setkeycodes e060 <keycode>' to make it known.
in dmesg.

Quoted 3 lines

Don't try the script without the sleep command unless you have a network connection to log in and kill the script ;)

Seems to work fine here. The led is blinking rapidly but I can type just fine and touchpad works as well.

What kind of box do you have? UP/SMP, Preempt?

Signature · 1 line
Dmitry
#2 lore raw
Quoted 4 lines

Seems to work fine here. The led is blinking rapidly but I can type just fine and touchpad works as well.

What kind of box do you have? UP/SMP, Preempt?

UP, Celeron 900 on i815. Happens on 2 identical computers, one preempt, one not preempt. PS/2 keyboard and mouse on one, only PS/2 keyboard on the other (and USB mouse that is probably unimportant).

Signature · 1 line
Meelis Roos
#3 lore raw
Quoted 9 lines · Meelis Roos
Quoted 4 lines

Seems to work fine here. The led is blinking rapidly but I can type just fine and touchpad works as well.

What kind of box do you have? UP/SMP, Preempt?

UP, Celeron 900 on i815. Happens on 2 identical computers, one preempt, one not preempt. PS/2 keyboard and mouse on one, only PS/2 keyboard on the other (and USB mouse that is probably unimportant).

The big input update went in with 2.6.9-rc2-bk4.Could you try booting -bk3 and -bk4 to verify that those changes are to blame?

Signature · 1 line
Dmitry
#4 lore raw
Quoted 6 lines · In article <[email protected]> you wrote:
Quoted 5 lines · Meelis Roos
Quoted 4 lines

Seems to work fine here. The led is blinking rapidly but I can type just fine and touchpad works as well.

What kind of box do you have? UP/SMP, Preempt?

Quoted 7 lines
Quoted 4 lines

UP, Celeron 900 on i815. Happens on 2 identical computers, one preempt, one not preempt. PS/2 keyboard and mouse on one, only PS/2 keyboard on the other (and USB mouse that is probably unimportant).

The big input update went in with 2.6.9-rc2-bk4.Could you try booting -bk3 and -bk4 to verify that those changes are to blame?

No, this bug appears with 2.6.9-rc2-bk3. I'm afraid that introduction of atkbd_schedule_command() & related stuff into atkbd.c is to blame.

Signature · 1 line
Ville Hallik
#5 lore raw
Quoted 12 lines · Ville Hallik
Quoted 10 lines · In article <[email protected]> you wrote:
Quoted 9 lines · Meelis Roos
Quoted 4 lines

Seems to work fine here. The led is blinking rapidly but I can type just fine and touchpad works as well.

What kind of box do you have? UP/SMP, Preempt?

UP, Celeron 900 on i815. Happens on 2 identical computers, one preempt, one not preempt. PS/2 keyboard and mouse on one, only PS/2 keyboard on the other (and USB mouse that is probably unimportant).

Quoted 6 lines
Quoted 2 lines

The big input update went in with 2.6.9-rc2-bk4.Could you try booting -bk3 and -bk4 to verify that those changes are to blame?

No, this bug appears with 2.6.9-rc2-bk3. I'm afraid that introduction of atkbd_schedule_command() & related stuff into atkbd.c is to blame.

Actually it is ACK processing hardening that is very useful at setup stage but is getting in our way once keyboard is initialized and commands are intermixed with good data.

Could you please try the patch below? It is just a quick hack, just to prove the idea. If it works for you I will prepare the proper fix later.

Signature · 14 lines
Dmitry

===== drivers/input/serio/libps2.c 1.2 vs edited =====
--- 1.2/drivers/input/serio/libps2.c	2004-10-20 03:13:08 -05:00
+++ edited/drivers/input/serio/libps2.c	2005-01-06 01:20:11 -05:00
@@ -250,7 +250,7 @@
 			}
 			/* Fall through */
 		default:
-			return 1;
+			return 0;
 	}
 
 	if (!ps2dev->nak && ps2dev->cmdcnt)
#6 lore raw
Quoted 2 lines

Could you please try the patch below? It is just a quick hack, just to prove the idea. If it works for you I will prepare the proper fix later.

Seems to cure it, cannot find any problems in 100+ keypresses.

Signature · 1 line
Meelis Roos
#7 lore raw
In reply to Dmitry Torokhov
Quoted 14 lines · In article <[email protected]> you wrote:

Actually it is ACK processing hardening that is very useful at setup stage but is getting in our way once keyboard is initialized and commands are intermixed with good data.

Could you please try the patch below? It is just a quick hack, just to prove the idea. If it works for you I will prepare the proper fix later.

Signature · 3 lines
Dmitry

===== drivers/input/serio/libps2.c 1.2 vs edited =====

drivers/input/serio/libps2.c 2005-01-06 01:20:11 -05:00 line 256

Quoted 8 lines
drivers/input/serio/libps2.c 2005-01-06 01:20:11 -05:00 renamed from drivers/input/serio/libps2.c 2004-10-20 03:13:08 -05:00 +1 -1
@@ -250,7 +250,7 @@
                       }
                       /* Fall through */
               default:
-                       return 1;
+                       return 0;
       }
 
       if (!ps2dev->nak && ps2dev->cmdcnt)

This quick hack works for me too. Thanks!

However, it is still easy to make PS/2 keyboard and mouse completely unusable with the following "sleepless" shell script (but it probably does not qualify as DoS because access to PS/2 keyboard is limited to local user only):

while : ; do xset led 3 ; xset -led 3 ; done

Even after killing this over network login, both keyboard and mouse are still unresponsive for about 10..20 seconds. It was not that fatal with 2.6.8.

Signature · 1 line
Ville Hallik