From: Greg Kroah-Hartman Date: Mon, 8 Jul 2024 10:45:13 +0000 (+0200) Subject: 6.6-stable patches X-Git-Tag: v6.6.38~45 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d7f510e2e634d77b7861c404a2bf29e5183f3bee;p=thirdparty%2Fkernel%2Fstable-queue.git 6.6-stable patches added patches: cpu-fix-broken-cmdline-nosmp-and-maxcpus-0.patch platform-x86-toshiba_acpi-fix-quickstart-quirk-handling.patch --- diff --git a/queue-6.6/cpu-fix-broken-cmdline-nosmp-and-maxcpus-0.patch b/queue-6.6/cpu-fix-broken-cmdline-nosmp-and-maxcpus-0.patch new file mode 100644 index 00000000000..d2ca4037cef --- /dev/null +++ b/queue-6.6/cpu-fix-broken-cmdline-nosmp-and-maxcpus-0.patch @@ -0,0 +1,43 @@ +From 6ef8eb5125722c241fd60d7b0c872d5c2e5dd4ca Mon Sep 17 00:00:00 2001 +From: Huacai Chen +Date: Tue, 18 Jun 2024 16:13:36 +0800 +Subject: cpu: Fix broken cmdline "nosmp" and "maxcpus=0" + +From: Huacai Chen + +commit 6ef8eb5125722c241fd60d7b0c872d5c2e5dd4ca upstream. + +After the rework of "Parallel CPU bringup", the cmdline "nosmp" and +"maxcpus=0" parameters are not working anymore. These parameters set +setup_max_cpus to zero and that's handed to bringup_nonboot_cpus(). + +The code there does a decrement before checking for zero, which brings it +into the negative space and brings up all CPUs. + +Add a zero check at the beginning of the function to prevent this. + +[ tglx: Massaged change log ] + +Fixes: 18415f33e2ac4ab382 ("cpu/hotplug: Allow "parallel" bringup up to CPUHP_BP_KICK_AP_STATE") +Fixes: 06c6796e0304234da6 ("cpu/hotplug: Fix off by one in cpuhp_bringup_mask()") +Signed-off-by: Huacai Chen +Signed-off-by: Thomas Gleixner +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20240618081336.3996825-1-chenhuacai@loongson.cn +Signed-off-by: Greg Kroah-Hartman +--- + kernel/cpu.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/kernel/cpu.c ++++ b/kernel/cpu.c +@@ -1907,6 +1907,9 @@ static inline bool cpuhp_bringup_cpus_pa + + void __init bringup_nonboot_cpus(unsigned int setup_max_cpus) + { ++ if (!setup_max_cpus) ++ return; ++ + /* Try parallel bringup optimization if enabled */ + if (cpuhp_bringup_cpus_parallel(setup_max_cpus)) + return; diff --git a/queue-6.6/platform-x86-toshiba_acpi-fix-quickstart-quirk-handling.patch b/queue-6.6/platform-x86-toshiba_acpi-fix-quickstart-quirk-handling.patch new file mode 100644 index 00000000000..aabcabf9aa7 --- /dev/null +++ b/queue-6.6/platform-x86-toshiba_acpi-fix-quickstart-quirk-handling.patch @@ -0,0 +1,98 @@ +From e527a6127223b644e0a27b44f4b16e16eb6c7f0a Mon Sep 17 00:00:00 2001 +From: Armin Wolf +Date: Mon, 1 Jul 2024 21:45:39 +0200 +Subject: platform/x86: toshiba_acpi: Fix quickstart quirk handling + +From: Armin Wolf + +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 +Closes: https://lore.kernel.org/platform-driver-x86/R4CYFS.TWB8QUU2SHWI1@cock.li/ +Tested-by: kemal +Cc: stable@vger.kernel.org +Signed-off-by: Armin Wolf +Link: https://lore.kernel.org/r/20240701194539.348937-1-W_Armin@gmx.de +Reviewed-by: Hans de Goede +Signed-off-by: Hans de Goede +Signed-off-by: Greg Kroah-Hartman +--- + 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 +@@ -3275,7 +3275,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 */ +@@ -3310,8 +3310,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) +@@ -3464,16 +3462,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); +@@ -3622,10 +3610,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"); diff --git a/queue-6.6/series b/queue-6.6/series index c14a3bc5cd6..90e2e8521b6 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -84,3 +84,5 @@ selftests-make-order-checking-verbose-in-msg_zerocop.patch inet_diag-initialize-pad-field-in-struct-inet_diag_r.patch mlxsw-core_linecards-fix-double-memory-deallocation-.patch gpiolib-of-add-polarity-quirk-for-tsc2005.patch +cpu-fix-broken-cmdline-nosmp-and-maxcpus-0.patch +platform-x86-toshiba_acpi-fix-quickstart-quirk-handling.patch