]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jan 2024 17:10:59 +0000 (09:10 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jan 2024 17:10:59 +0000 (09:10 -0800)
added patches:
input-atkbd-use-ab83-as-id-when-skipping-the-getid-command.patch

queue-4.19/input-atkbd-use-ab83-as-id-when-skipping-the-getid-command.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/input-atkbd-use-ab83-as-id-when-skipping-the-getid-command.patch b/queue-4.19/input-atkbd-use-ab83-as-id-when-skipping-the-getid-command.patch
new file mode 100644 (file)
index 0000000..db80590
--- /dev/null
@@ -0,0 +1,75 @@
+From 58f65f9db7e0de366a5a115c2e2c0703858bba69 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Tue, 16 Jan 2024 21:43:25 +0100
+Subject: Input: atkbd - use ab83 as id when skipping the getid command
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+commit 58f65f9db7e0de366a5a115c2e2c0703858bba69 upstream.
+
+Barnabás reported that the change to skip the getid command
+when the controller is in translated mode on laptops caused
+the Version field of his "AT Translated Set 2 keyboard"
+input device to change from ab83 to abba, breaking a custom
+hwdb entry for this keyboard.
+
+Use the standard ab83 id for keyboards when getid is skipped
+(rather then that getid fails) to avoid reporting a different
+Version to userspace then before skipping the getid.
+
+Fixes: 936e4d49ecbc ("Input: atkbd - skip ATKBD_CMD_GETID in translated mode")
+Reported-by: Barnabás Pőcze <pobrn@protonmail.com>
+Closes: https://lore.kernel.org/linux-input/W1ydwoG2fYv85Z3C3yfDOJcVpilEvGge6UGa9kZh8zI2-qkHXp7WLnl2hSkFz63j-c7WupUWI5TLL6n7Lt8DjRuU-yJBwLYWrreb1hbnd6A=@protonmail.com/
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Link: https://lore.kernel.org/r/20240116204325.7719-1-hdegoede@redhat.com
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/input/keyboard/atkbd.c |   12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+--- a/drivers/input/keyboard/atkbd.c
++++ b/drivers/input/keyboard/atkbd.c
+@@ -743,9 +743,9 @@ static bool atkbd_is_portable_device(voi
+  * not work. So in this case simply assume a keyboard is connected to avoid
+  * confusing some laptop keyboards.
+  *
+- * Skipping ATKBD_CMD_GETID ends up using a fake keyboard id. Using a fake id is
+- * ok in translated mode, only atkbd_select_set() checks atkbd->id and in
+- * translated mode that is a no-op.
++ * Skipping ATKBD_CMD_GETID ends up using a fake keyboard id. Using the standard
++ * 0xab83 id is ok in translated mode, only atkbd_select_set() checks atkbd->id
++ * and in translated mode that is a no-op.
+  */
+ static bool atkbd_skip_getid(struct atkbd *atkbd)
+ {
+@@ -763,6 +763,7 @@ static int atkbd_probe(struct atkbd *atk
+ {
+       struct ps2dev *ps2dev = &atkbd->ps2dev;
+       unsigned char param[2];
++      bool skip_getid;
+ /*
+  * Some systems, where the bit-twiddling when testing the io-lines of the
+@@ -784,7 +785,8 @@ static int atkbd_probe(struct atkbd *atk
+  */
+       param[0] = param[1] = 0xa5;     /* initialize with invalid values */
+-      if (atkbd_skip_getid(atkbd) || ps2_command(ps2dev, param, ATKBD_CMD_GETID)) {
++      skip_getid = atkbd_skip_getid(atkbd);
++      if (skip_getid || ps2_command(ps2dev, param, ATKBD_CMD_GETID)) {
+ /*
+  * If the get ID command was skipped or failed, we check if we can at least set
+@@ -794,7 +796,7 @@ static int atkbd_probe(struct atkbd *atk
+               param[0] = 0;
+               if (ps2_command(ps2dev, param, ATKBD_CMD_SETLEDS))
+                       return -1;
+-              atkbd->id = 0xabba;
++              atkbd->id = skip_getid ? 0xab83 : 0xabba;
+               return 0;
+       }
index 05f890ef6a4a7fd34ff987919d4e9b8bbb7be54d..e7b167bbd52fd5b18a02c7e3f8f516d743a96635 100644 (file)
@@ -110,3 +110,4 @@ mmc-sdhci_omap-fix-ti-soc-dependencies.patch
 of-fix-double-free-in-of_parse_phandle_with_args_map.patch
 of-unittest-fix-of_count_phandle_with_args-expected-.patch
 binder-fix-async-space-check-for-0-sized-buffers.patch
+input-atkbd-use-ab83-as-id-when-skipping-the-getid-command.patch