From 2d10447c26f90e2d0610d78298c0cd7f11d738f3 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 22 Jan 2024 09:10:27 -0800 Subject: [PATCH] 6.6-stable patches added patches: input-atkbd-use-ab83-as-id-when-skipping-the-getid-command.patch mips-smp-call-rcutree_report_cpu_starting-earlier.patch --- ...s-id-when-skipping-the-getid-command.patch | 75 +++++++++++++++++++ ...-rcutree_report_cpu_starting-earlier.patch | 72 ++++++++++++++++++ queue-6.6/series | 2 + 3 files changed, 149 insertions(+) create mode 100644 queue-6.6/input-atkbd-use-ab83-as-id-when-skipping-the-getid-command.patch create mode 100644 queue-6.6/mips-smp-call-rcutree_report_cpu_starting-earlier.patch diff --git a/queue-6.6/input-atkbd-use-ab83-as-id-when-skipping-the-getid-command.patch b/queue-6.6/input-atkbd-use-ab83-as-id-when-skipping-the-getid-command.patch new file mode 100644 index 00000000000..4dd0abbb7d9 --- /dev/null +++ b/queue-6.6/input-atkbd-use-ab83-as-id-when-skipping-the-getid-command.patch @@ -0,0 +1,75 @@ +From 58f65f9db7e0de366a5a115c2e2c0703858bba69 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +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 + +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 +Closes: https://lore.kernel.org/linux-input/W1ydwoG2fYv85Z3C3yfDOJcVpilEvGge6UGa9kZh8zI2-qkHXp7WLnl2hSkFz63j-c7WupUWI5TLL6n7Lt8DjRuU-yJBwLYWrreb1hbnd6A=@protonmail.com/ +Signed-off-by: Hans de Goede +Link: https://lore.kernel.org/r/20240116204325.7719-1-hdegoede@redhat.com +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman +--- + 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 +@@ -791,9 +791,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) + { +@@ -811,6 +811,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 +@@ -832,7 +833,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 +@@ -842,7 +844,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; + } + diff --git a/queue-6.6/mips-smp-call-rcutree_report_cpu_starting-earlier.patch b/queue-6.6/mips-smp-call-rcutree_report_cpu_starting-earlier.patch new file mode 100644 index 00000000000..9f002ae8148 --- /dev/null +++ b/queue-6.6/mips-smp-call-rcutree_report_cpu_starting-earlier.patch @@ -0,0 +1,72 @@ +From 55702ec9603ebeffb15e6f7b113623fe1d8872f4 Mon Sep 17 00:00:00 2001 +From: Stefan Wiehler +Date: Mon, 6 Nov 2023 13:12:07 +0100 +Subject: mips/smp: Call rcutree_report_cpu_starting() earlier + +From: Stefan Wiehler + +commit 55702ec9603ebeffb15e6f7b113623fe1d8872f4 upstream. + +rcutree_report_cpu_starting() must be called before +clockevents_register_device() to avoid the following lockdep splat triggered by +calling list_add() when CONFIG_PROVE_RCU_LIST=y: + + WARNING: suspicious RCU usage + ... + ----------------------------- + kernel/locking/lockdep.c:3680 RCU-list traversed in non-reader section!! + + other info that might help us debug this: + + RCU used illegally from offline CPU! + rcu_scheduler_active = 1, debug_locks = 1 + no locks held by swapper/1/0. + ... + Call Trace: + [] show_stack+0x64/0x158 + [] dump_stack_lvl+0x90/0xc4 + [] __lock_acquire+0x1404/0x2940 + [] lock_acquire+0x14c/0x448 + [] _raw_spin_lock_irqsave+0x50/0x88 + [] clockevents_register_device+0x60/0x1e8 + [] r4k_clockevent_init+0x220/0x3a0 + [] start_secondary+0x50/0x3b8 + +raw_smp_processor_id() is required in order to avoid calling into lockdep +before RCU has declared the CPU to be watched for readers. + +See also commit 29368e093921 ("x86/smpboot: Move rcu_cpu_starting() earlier"), +commit de5d9dae150c ("s390/smp: move rcu_cpu_starting() earlier") and commit +99f070b62322 ("powerpc/smp: Call rcu_cpu_starting() earlier"). + +Signed-off-by: Stefan Wiehler +Reviewed-by: Huacai Chen +Signed-off-by: Thomas Bogendoerfer +Signed-off-by: Greg Kroah-Hartman +--- + arch/mips/kernel/smp.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/mips/kernel/smp.c ++++ b/arch/mips/kernel/smp.c +@@ -351,10 +351,11 @@ early_initcall(mips_smp_ipi_init); + */ + asmlinkage void start_secondary(void) + { +- unsigned int cpu; ++ unsigned int cpu = raw_smp_processor_id(); + + cpu_probe(); + per_cpu_trap_init(false); ++ rcu_cpu_starting(cpu); + mips_clockevent_init(); + mp_ops->init_secondary(); + cpu_report(); +@@ -366,7 +367,6 @@ asmlinkage void start_secondary(void) + */ + + calibrate_delay(); +- cpu = smp_processor_id(); + cpu_data[cpu].udelay_val = loops_per_jiffy; + + set_cpu_sibling_map(cpu); diff --git a/queue-6.6/series b/queue-6.6/series index 2ff0f2e8b24..e3ccb2d5a04 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -345,3 +345,5 @@ selftests-bpf-add-assert-for-user-stacks-in-test_task_stack.patch keys-dns-fix-size-check-of-v1-server-list-header.patch binder-fix-async-space-check-for-0-sized-buffers.patch binder-fix-unused-alloc-free_async_space.patch +mips-smp-call-rcutree_report_cpu_starting-earlier.patch +input-atkbd-use-ab83-as-id-when-skipping-the-getid-command.patch -- 2.47.3