]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Jul 2024 10:45:25 +0000 (12:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Jul 2024 10:45:25 +0000 (12:45 +0200)
added patches:
platform-x86-toshiba_acpi-fix-quickstart-quirk-handling.patch

queue-6.9/platform-x86-toshiba_acpi-fix-quickstart-quirk-handling.patch [new file with mode: 0644]
queue-6.9/series

diff --git a/queue-6.9/platform-x86-toshiba_acpi-fix-quickstart-quirk-handling.patch b/queue-6.9/platform-x86-toshiba_acpi-fix-quickstart-quirk-handling.patch
new file mode 100644 (file)
index 0000000..96b15fa
--- /dev/null
@@ -0,0 +1,98 @@
+From e527a6127223b644e0a27b44f4b16e16eb6c7f0a Mon Sep 17 00:00:00 2001
+From: Armin Wolf <W_Armin@gmx.de>
+Date: Mon, 1 Jul 2024 21:45:39 +0200
+Subject: platform/x86: toshiba_acpi: Fix quickstart quirk handling
+
+From: Armin Wolf <W_Armin@gmx.de>
+
+commit e527a6127223b644e0a27b44f4b16e16eb6c7f0a upstream.
+
+The global hci_hotkey_quickstart quirk flag is tested in
+toshiba_acpi_enable_hotkeys() before the quirk flag is properly
+initialized based on SMBIOS data. This causes the quirk to be
+applied to all models, some of which behave erratically as a
+result.
+
+Fix this by initializing the global quirk flags during module
+initialization before registering the ACPI driver. This also
+allows us to mark toshiba_dmi_quirks[] as __initconst.
+
+Fixes: 23f1d8b47d12 ("platform/x86: toshiba_acpi: Add quirk for buttons on Z830")
+Reported-by: kemal <kmal@cock.li>
+Closes: https://lore.kernel.org/platform-driver-x86/R4CYFS.TWB8QUU2SHWI1@cock.li/
+Tested-by: kemal <kmal@cock.li>
+Cc: stable@vger.kernel.org
+Signed-off-by: Armin Wolf <W_Armin@gmx.de>
+Link: https://lore.kernel.org/r/20240701194539.348937-1-W_Armin@gmx.de
+Reviewed-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/platform/x86/toshiba_acpi.c |   31 ++++++++++++++++++-------------
+ 1 file changed, 18 insertions(+), 13 deletions(-)
+
+--- a/drivers/platform/x86/toshiba_acpi.c
++++ b/drivers/platform/x86/toshiba_acpi.c
+@@ -3276,7 +3276,7 @@ static const char *find_hci_method(acpi_
+  */
+ #define QUIRK_HCI_HOTKEY_QUICKSTART           BIT(1)
+-static const struct dmi_system_id toshiba_dmi_quirks[] = {
++static const struct dmi_system_id toshiba_dmi_quirks[] __initconst = {
+       {
+        /* Toshiba Portégé R700 */
+        /* https://bugzilla.kernel.org/show_bug.cgi?id=21012 */
+@@ -3311,8 +3311,6 @@ static int toshiba_acpi_add(struct acpi_
+       struct toshiba_acpi_dev *dev;
+       const char *hci_method;
+       u32 dummy;
+-      const struct dmi_system_id *dmi_id;
+-      long quirks = 0;
+       int ret = 0;
+       if (toshiba_acpi)
+@@ -3465,16 +3463,6 @@ iio_error:
+       }
+ #endif
+-      dmi_id = dmi_first_match(toshiba_dmi_quirks);
+-      if (dmi_id)
+-              quirks = (long)dmi_id->driver_data;
+-
+-      if (turn_on_panel_on_resume == -1)
+-              turn_on_panel_on_resume = !!(quirks & QUIRK_TURN_ON_PANEL_ON_RESUME);
+-
+-      if (hci_hotkey_quickstart == -1)
+-              hci_hotkey_quickstart = !!(quirks & QUIRK_HCI_HOTKEY_QUICKSTART);
+-
+       toshiba_wwan_available(dev);
+       if (dev->wwan_supported)
+               toshiba_acpi_setup_wwan_rfkill(dev);
+@@ -3624,10 +3612,27 @@ static struct acpi_driver toshiba_acpi_d
+       .drv.pm = &toshiba_acpi_pm,
+ };
++static void __init toshiba_dmi_init(void)
++{
++      const struct dmi_system_id *dmi_id;
++      long quirks = 0;
++
++      dmi_id = dmi_first_match(toshiba_dmi_quirks);
++      if (dmi_id)
++              quirks = (long)dmi_id->driver_data;
++
++      if (turn_on_panel_on_resume == -1)
++              turn_on_panel_on_resume = !!(quirks & QUIRK_TURN_ON_PANEL_ON_RESUME);
++
++      if (hci_hotkey_quickstart == -1)
++              hci_hotkey_quickstart = !!(quirks & QUIRK_HCI_HOTKEY_QUICKSTART);
++}
++
+ static int __init toshiba_acpi_init(void)
+ {
+       int ret;
++      toshiba_dmi_init();
+       toshiba_proc_dir = proc_mkdir(PROC_TOSHIBA, acpi_root_dir);
+       if (!toshiba_proc_dir) {
+               pr_err("Unable to create proc dir " PROC_TOSHIBA "\n");
index aa17efe75febbfa430aec4358fa2ec60d9fc2e23..e8e582ad5ac5cc7465519571f1bfca24a1bee6bd 100644 (file)
@@ -128,3 +128,4 @@ inet_diag-initialize-pad-field-in-struct-inet_diag_r.patch
 mlxsw-core_linecards-fix-double-memory-deallocation-.patch
 bnxt_en-fix-the-resource-check-condition-for-rss-con.patch
 gpiolib-of-add-polarity-quirk-for-tsc2005.patch
+platform-x86-toshiba_acpi-fix-quickstart-quirk-handling.patch