Skip to contentSkip to conversation

Input: atkbd - do not skip atkbd_deactivate() when skipping ATKBD_CMD_GETID

PATCH In review Wang Hai 2 participants 2 messages Jul 15, 2025

Subsystems (2)
lore
Share & tools
lore

Wang Hai

author
#0 lore raw

PATCH 1/1 Input: atkbd - do not skip atkbd_deactivate() when skipping ATKBD_CMD_GETID

From: Hans de Goede <[email protected]>

commit 9cf6e24c9fbf17e52de9fff07f12be7565ea6d61 upstream.

After commit 936e4d49ecbc ("Input: atkbd - skip ATKBD_CMD_GETID in translated mode") not only the getid command is skipped, but also the de-activating of the keyboard at the end of atkbd_probe(), potentially re-introducing the problem fixed by commit be2d7e4233a4 ("Input: atkbd - fix multi-byte scancode handling on reconnect").

Make sure multi-byte scancode handling on reconnect is still handled correctly by not skipping the atkbd_deactivate() call.

Fixes 936e4d49ecbc ("Input: atkbd - skip ATKBD_CMD_GETID in translated mode")
---
 drivers/input/keyboard/atkbd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/input/keyboard/atkbd.c +2 -1
index b3a856333d4e..de59fc1a24bc 100644
@@ -805,11 +805,11 @@ static int atkbd_probe(struct atkbd *atkbd)
 				 "keyboard reset failed on %s\n",
 				 ps2dev->serio->phys);
 
 	if (atkbd_skip_getid(atkbd)) {
 		atkbd->id = 0xab83;
-		return 0;
+		goto deactivate_kbd;
 	}
 
 /*
  * Then we check the keyboard ID. We should get 0xab83 under normal conditions.
  * Some keyboards report different values, but the first byte is always 0xab or
@@ -842,10 +842,11 @@ static int atkbd_probe(struct atkbd *atkbd)
 			"NCD terminal keyboards are only supported on non-translating controllers. "
 			"Use i8042.direct=1 to disable translation.\n");
 		return -1;
 	}
 
+deactivate_kbd:
 /*
  * Make sure nothing is coming from the keyboard and disturbs our
  * internal state.
  */
 	if (!atkbd_skip_deactivate)
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw

Hi,

Quoted 13 lines · Wang Hai

From: Hans de Goede <[email protected]>

commit 9cf6e24c9fbf17e52de9fff07f12be7565ea6d61 upstream.

After commit 936e4d49ecbc ("Input: atkbd - skip ATKBD_CMD_GETID in translated mode") not only the getid command is skipped, but also the de-activating of the keyboard at the end of atkbd_probe(), potentially re-introducing the problem fixed by commit be2d7e4233a4 ("Input: atkbd - fix multi-byte scancode handling on reconnect").

Make sure multi-byte scancode handling on reconnect is still handled correctly by not skipping the atkbd_deactivate() call.

Quoted 6 lines
Fixes 936e4d49ecbc ("Input: atkbd - skip ATKBD_CMD_GETID in translated mode")

Thank you for backporting this.

The backport looks good to me:

Regards,

Hans

Quoted 33 lines
---
 drivers/input/keyboard/atkbd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/input/keyboard/atkbd.c +2 -1
index b3a856333d4e..de59fc1a24bc 100644
@@ -805,11 +805,11 @@ static int atkbd_probe(struct atkbd *atkbd)
 				 "keyboard reset failed on %s\n",
 				 ps2dev->serio->phys);
 
 	if (atkbd_skip_getid(atkbd)) {
 		atkbd->id = 0xab83;
-		return 0;
+		goto deactivate_kbd;
 	}
 
 /*
  * Then we check the keyboard ID. We should get 0xab83 under normal conditions.
  * Some keyboards report different values, but the first byte is always 0xab or
@@ -842,10 +842,11 @@ static int atkbd_probe(struct atkbd *atkbd)
 			"NCD terminal keyboards are only supported on non-translating controllers. "
 			"Use i8042.direct=1 to disable translation.\n");
 		return -1;
 	}
 
+deactivate_kbd:
 /*
  * Make sure nothing is coming from the keyboard and disturbs our
  * internal state.
  */
 	if (!atkbd_skip_deactivate)