From: Greg Kroah-Hartman Date: Tue, 22 Apr 2025 07:44:07 +0000 (+0200) Subject: 6.14-stable patches X-Git-Tag: v6.1.135~92 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cbc9f8d5e655e63606e6486a81ce3a1d06d78527;p=thirdparty%2Fkernel%2Fstable-queue.git 6.14-stable patches added patches: platform-x86-alienware-wmi-wmax-add-g-mode-support-to-alienware-m16-r1.patch platform-x86-alienware-wmi-wmax-extend-support-to-more-laptops.patch platform-x86-msi-wmi-platform-rename-data-variable.patch platform-x86-msi-wmi-platform-workaround-a-acpi-firmware-bug.patch --- diff --git a/queue-6.14/platform-x86-alienware-wmi-wmax-add-g-mode-support-to-alienware-m16-r1.patch b/queue-6.14/platform-x86-alienware-wmi-wmax-add-g-mode-support-to-alienware-m16-r1.patch new file mode 100644 index 0000000000..ef6e92e316 --- /dev/null +++ b/queue-6.14/platform-x86-alienware-wmi-wmax-add-g-mode-support-to-alienware-m16-r1.patch @@ -0,0 +1,36 @@ +From 5ff79cabb23a2f14d2ed29e9596aec908905a0e6 Mon Sep 17 00:00:00 2001 +From: Kurt Borja +Date: Fri, 11 Apr 2025 11:14:35 -0300 +Subject: platform/x86: alienware-wmi-wmax: Add G-Mode support to Alienware m16 R1 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Kurt Borja + +commit 5ff79cabb23a2f14d2ed29e9596aec908905a0e6 upstream. + +Some users report the Alienware m16 R1 models, support G-Mode. This was +manually verified by inspecting their ACPI tables. + +Cc: stable@vger.kernel.org +Signed-off-by: Kurt Borja +Link: https://lore.kernel.org/r/20250411-awcc-support-v1-1-09a130ec4560@gmail.com +Reviewed-by: Ilpo Järvinen +Signed-off-by: Ilpo Järvinen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/platform/x86/dell/alienware-wmi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/platform/x86/dell/alienware-wmi.c ++++ b/drivers/platform/x86/dell/alienware-wmi.c +@@ -248,7 +248,7 @@ static const struct dmi_system_id alienw + DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m16 R1 AMD"), + }, +- .driver_data = &quirk_x_series, ++ .driver_data = &quirk_g_series, + }, + { + .callback = dmi_matched, diff --git a/queue-6.14/platform-x86-alienware-wmi-wmax-extend-support-to-more-laptops.patch b/queue-6.14/platform-x86-alienware-wmi-wmax-extend-support-to-more-laptops.patch new file mode 100644 index 0000000000..ef258f7f37 --- /dev/null +++ b/queue-6.14/platform-x86-alienware-wmi-wmax-extend-support-to-more-laptops.patch @@ -0,0 +1,128 @@ +From 202a861205905629c5f10ce0a8358623485e1ae9 Mon Sep 17 00:00:00 2001 +From: Kurt Borja +Date: Fri, 11 Apr 2025 11:14:36 -0300 +Subject: platform/x86: alienware-wmi-wmax: Extend support to more laptops +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Kurt Borja + +commit 202a861205905629c5f10ce0a8358623485e1ae9 upstream. + +Extend thermal control support to: + + - Alienware Area-51m R2 + - Alienware m16 R1 + - Alienware m16 R2 + - Dell G16 7630 + - Dell G5 5505 SE + +Cc: stable@vger.kernel.org +Signed-off-by: Kurt Borja +Link: https://lore.kernel.org/r/20250411-awcc-support-v1-2-09a130ec4560@gmail.com +Reviewed-by: Ilpo Järvinen +Signed-off-by: Ilpo Järvinen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/platform/x86/dell/alienware-wmi.c | 54 ++++++++++++++++++++++++++++++ + 1 file changed, 54 insertions(+) + +--- a/drivers/platform/x86/dell/alienware-wmi.c ++++ b/drivers/platform/x86/dell/alienware-wmi.c +@@ -216,6 +216,15 @@ static int __init dmi_matched(const stru + static const struct dmi_system_id alienware_quirks[] __initconst = { + { + .callback = dmi_matched, ++ .ident = "Alienware Area-51m R2", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "Alienware Area-51m R2"), ++ }, ++ .driver_data = &quirk_x_series, ++ }, ++ { ++ .callback = dmi_matched, + .ident = "Alienware ASM100", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), +@@ -243,6 +252,15 @@ static const struct dmi_system_id alienw + }, + { + .callback = dmi_matched, ++ .ident = "Alienware m16 R1", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m16 R1"), ++ }, ++ .driver_data = &quirk_g_series, ++ }, ++ { ++ .callback = dmi_matched, + .ident = "Alienware m16 R1 AMD", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), +@@ -261,6 +279,15 @@ static const struct dmi_system_id alienw + }, + { + .callback = dmi_matched, ++ .ident = "Alienware m16 R2", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m16 R2"), ++ }, ++ .driver_data = &quirk_x_series, ++ }, ++ { ++ .callback = dmi_matched, + .ident = "Alienware m18 R2", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), +@@ -279,6 +306,15 @@ static const struct dmi_system_id alienw + }, + { + .callback = dmi_matched, ++ .ident = "Alienware x15 R2", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "Alienware x15 R2"), ++ }, ++ .driver_data = &quirk_x_series, ++ }, ++ { ++ .callback = dmi_matched, + .ident = "Alienware x17 R2", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), +@@ -342,6 +378,15 @@ static const struct dmi_system_id alienw + }, + { + .callback = dmi_matched, ++ .ident = "Dell Inc. G16 7630", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "Dell G16 7630"), ++ }, ++ .driver_data = &quirk_g_series, ++ }, ++ { ++ .callback = dmi_matched, + .ident = "Dell Inc. G3 3500", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), +@@ -367,6 +412,15 @@ static const struct dmi_system_id alienw + }, + .driver_data = &quirk_g_series, + }, ++ { ++ .callback = dmi_matched, ++ .ident = "Dell Inc. G5 5505", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "G5 5505"), ++ }, ++ .driver_data = &quirk_g_series, ++ }, + { + .callback = dmi_matched, + .ident = "Dell Inc. Inspiron 5675", diff --git a/queue-6.14/platform-x86-msi-wmi-platform-rename-data-variable.patch b/queue-6.14/platform-x86-msi-wmi-platform-rename-data-variable.patch new file mode 100644 index 0000000000..dd510ce6cf --- /dev/null +++ b/queue-6.14/platform-x86-msi-wmi-platform-rename-data-variable.patch @@ -0,0 +1,51 @@ +From 912d614ac99e137fd2016777e4b090c46ce84898 Mon Sep 17 00:00:00 2001 +From: Armin Wolf +Date: Mon, 14 Apr 2025 16:04:52 +0200 +Subject: platform/x86: msi-wmi-platform: Rename "data" variable +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Armin Wolf + +commit 912d614ac99e137fd2016777e4b090c46ce84898 upstream. + +Rename the "data" variable inside msi_wmi_platform_read() to avoid +a name collision when the driver adds support for a state container +struct (that is to be called "data" too) in the future. + +Signed-off-by: Armin Wolf +Link: https://lore.kernel.org/r/20250414140453.7691-1-W_Armin@gmx.de +Reviewed-by: Ilpo Järvinen +Signed-off-by: Ilpo Järvinen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/platform/x86/msi-wmi-platform.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/platform/x86/msi-wmi-platform.c ++++ b/drivers/platform/x86/msi-wmi-platform.c +@@ -173,7 +173,7 @@ static int msi_wmi_platform_read(struct + struct wmi_device *wdev = dev_get_drvdata(dev); + u8 input[32] = { 0 }; + u8 output[32]; +- u16 data; ++ u16 value; + int ret; + + ret = msi_wmi_platform_query(wdev, MSI_PLATFORM_GET_FAN, input, sizeof(input), output, +@@ -181,11 +181,11 @@ static int msi_wmi_platform_read(struct + if (ret < 0) + return ret; + +- data = get_unaligned_be16(&output[channel * 2 + 1]); +- if (!data) ++ value = get_unaligned_be16(&output[channel * 2 + 1]); ++ if (!value) + *val = 0; + else +- *val = 480000 / data; ++ *val = 480000 / value; + + return 0; + } diff --git a/queue-6.14/platform-x86-msi-wmi-platform-workaround-a-acpi-firmware-bug.patch b/queue-6.14/platform-x86-msi-wmi-platform-workaround-a-acpi-firmware-bug.patch new file mode 100644 index 0000000000..ff13b13644 --- /dev/null +++ b/queue-6.14/platform-x86-msi-wmi-platform-workaround-a-acpi-firmware-bug.patch @@ -0,0 +1,302 @@ +From baf2f2c2b4c8e1d398173acd4d2fa9131a86b84e Mon Sep 17 00:00:00 2001 +From: Armin Wolf +Date: Mon, 14 Apr 2025 16:04:53 +0200 +Subject: platform/x86: msi-wmi-platform: Workaround a ACPI firmware bug +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Armin Wolf + +commit baf2f2c2b4c8e1d398173acd4d2fa9131a86b84e upstream. + +The ACPI byte code inside the ACPI control method responsible for +handling the WMI method calls uses a global buffer for constructing +the return value, yet the ACPI control method itself is not marked +as "Serialized". +This means that calling WMI methods on this WMI device is not +thread-safe, as concurrent WMI method calls will corrupt the global +buffer. + +Fix this by serializing the WMI method calls using a mutex. + +Cc: stable@vger.kernel.org # 6.x.x: 912d614ac99e: platform/x86: msi-wmi-platform: Rename "data" variable +Fixes: 9c0beb6b29e7 ("platform/x86: wmi: Add MSI WMI Platform driver") +Tested-by: Antheas Kapenekakis +Signed-off-by: Armin Wolf +Link: https://lore.kernel.org/r/20250414140453.7691-2-W_Armin@gmx.de +Reviewed-by: Ilpo Järvinen +Signed-off-by: Ilpo Järvinen +Signed-off-by: Greg Kroah-Hartman +--- + Documentation/wmi/devices/msi-wmi-platform.rst | 4 + + drivers/platform/x86/msi-wmi-platform.c | 91 ++++++++++++++++--------- + 2 files changed, 63 insertions(+), 32 deletions(-) + +--- a/Documentation/wmi/devices/msi-wmi-platform.rst ++++ b/Documentation/wmi/devices/msi-wmi-platform.rst +@@ -138,6 +138,10 @@ input data, the meaning of which depends + The output buffer contains a single byte which signals success or failure (``0x00`` on failure) + and 31 bytes of output data, the meaning if which depends on the subfeature being accessed. + ++.. note:: ++ The ACPI control method responsible for handling the WMI method calls is not thread-safe. ++ This is a firmware bug that needs to be handled inside the driver itself. ++ + WMI method Get_EC() + ------------------- + +--- a/drivers/platform/x86/msi-wmi-platform.c ++++ b/drivers/platform/x86/msi-wmi-platform.c +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -17,6 +18,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -76,8 +78,13 @@ enum msi_wmi_platform_method { + MSI_PLATFORM_GET_WMI = 0x1d, + }; + +-struct msi_wmi_platform_debugfs_data { ++struct msi_wmi_platform_data { + struct wmi_device *wdev; ++ struct mutex wmi_lock; /* Necessary when calling WMI methods */ ++}; ++ ++struct msi_wmi_platform_debugfs_data { ++ struct msi_wmi_platform_data *data; + enum msi_wmi_platform_method method; + struct rw_semaphore buffer_lock; /* Protects debugfs buffer */ + size_t length; +@@ -132,8 +139,9 @@ static int msi_wmi_platform_parse_buffer + return 0; + } + +-static int msi_wmi_platform_query(struct wmi_device *wdev, enum msi_wmi_platform_method method, +- u8 *input, size_t input_length, u8 *output, size_t output_length) ++static int msi_wmi_platform_query(struct msi_wmi_platform_data *data, ++ enum msi_wmi_platform_method method, u8 *input, ++ size_t input_length, u8 *output, size_t output_length) + { + struct acpi_buffer out = { ACPI_ALLOCATE_BUFFER, NULL }; + struct acpi_buffer in = { +@@ -147,9 +155,15 @@ static int msi_wmi_platform_query(struct + if (!input_length || !output_length) + return -EINVAL; + +- status = wmidev_evaluate_method(wdev, 0x0, method, &in, &out); +- if (ACPI_FAILURE(status)) +- return -EIO; ++ /* ++ * The ACPI control method responsible for handling the WMI method calls ++ * is not thread-safe. Because of this we have to do the locking ourself. ++ */ ++ scoped_guard(mutex, &data->wmi_lock) { ++ status = wmidev_evaluate_method(data->wdev, 0x0, method, &in, &out); ++ if (ACPI_FAILURE(status)) ++ return -EIO; ++ } + + obj = out.pointer; + if (!obj) +@@ -170,13 +184,13 @@ static umode_t msi_wmi_platform_is_visib + static int msi_wmi_platform_read(struct device *dev, enum hwmon_sensor_types type, u32 attr, + int channel, long *val) + { +- struct wmi_device *wdev = dev_get_drvdata(dev); ++ struct msi_wmi_platform_data *data = dev_get_drvdata(dev); + u8 input[32] = { 0 }; + u8 output[32]; + u16 value; + int ret; + +- ret = msi_wmi_platform_query(wdev, MSI_PLATFORM_GET_FAN, input, sizeof(input), output, ++ ret = msi_wmi_platform_query(data, MSI_PLATFORM_GET_FAN, input, sizeof(input), output, + sizeof(output)); + if (ret < 0) + return ret; +@@ -231,7 +245,7 @@ static ssize_t msi_wmi_platform_write(st + return ret; + + down_write(&data->buffer_lock); +- ret = msi_wmi_platform_query(data->wdev, data->method, payload, data->length, data->buffer, ++ ret = msi_wmi_platform_query(data->data, data->method, payload, data->length, data->buffer, + data->length); + up_write(&data->buffer_lock); + +@@ -277,17 +291,17 @@ static void msi_wmi_platform_debugfs_rem + debugfs_remove_recursive(dir); + } + +-static void msi_wmi_platform_debugfs_add(struct wmi_device *wdev, struct dentry *dir, ++static void msi_wmi_platform_debugfs_add(struct msi_wmi_platform_data *drvdata, struct dentry *dir, + const char *name, enum msi_wmi_platform_method method) + { + struct msi_wmi_platform_debugfs_data *data; + struct dentry *entry; + +- data = devm_kzalloc(&wdev->dev, sizeof(*data), GFP_KERNEL); ++ data = devm_kzalloc(&drvdata->wdev->dev, sizeof(*data), GFP_KERNEL); + if (!data) + return; + +- data->wdev = wdev; ++ data->data = drvdata; + data->method = method; + init_rwsem(&data->buffer_lock); + +@@ -298,82 +312,82 @@ static void msi_wmi_platform_debugfs_add + + entry = debugfs_create_file(name, 0600, dir, data, &msi_wmi_platform_debugfs_fops); + if (IS_ERR(entry)) +- devm_kfree(&wdev->dev, data); ++ devm_kfree(&drvdata->wdev->dev, data); + } + +-static void msi_wmi_platform_debugfs_init(struct wmi_device *wdev) ++static void msi_wmi_platform_debugfs_init(struct msi_wmi_platform_data *data) + { + struct dentry *dir; + char dir_name[64]; + int ret, method; + +- scnprintf(dir_name, ARRAY_SIZE(dir_name), "%s-%s", DRIVER_NAME, dev_name(&wdev->dev)); ++ scnprintf(dir_name, ARRAY_SIZE(dir_name), "%s-%s", DRIVER_NAME, dev_name(&data->wdev->dev)); + + dir = debugfs_create_dir(dir_name, NULL); + if (IS_ERR(dir)) + return; + +- ret = devm_add_action_or_reset(&wdev->dev, msi_wmi_platform_debugfs_remove, dir); ++ ret = devm_add_action_or_reset(&data->wdev->dev, msi_wmi_platform_debugfs_remove, dir); + if (ret < 0) + return; + + for (method = MSI_PLATFORM_GET_PACKAGE; method <= MSI_PLATFORM_GET_WMI; method++) +- msi_wmi_platform_debugfs_add(wdev, dir, msi_wmi_platform_debugfs_names[method - 1], ++ msi_wmi_platform_debugfs_add(data, dir, msi_wmi_platform_debugfs_names[method - 1], + method); + } + +-static int msi_wmi_platform_hwmon_init(struct wmi_device *wdev) ++static int msi_wmi_platform_hwmon_init(struct msi_wmi_platform_data *data) + { + struct device *hdev; + +- hdev = devm_hwmon_device_register_with_info(&wdev->dev, "msi_wmi_platform", wdev, ++ hdev = devm_hwmon_device_register_with_info(&data->wdev->dev, "msi_wmi_platform", data, + &msi_wmi_platform_chip_info, NULL); + + return PTR_ERR_OR_ZERO(hdev); + } + +-static int msi_wmi_platform_ec_init(struct wmi_device *wdev) ++static int msi_wmi_platform_ec_init(struct msi_wmi_platform_data *data) + { + u8 input[32] = { 0 }; + u8 output[32]; + u8 flags; + int ret; + +- ret = msi_wmi_platform_query(wdev, MSI_PLATFORM_GET_EC, input, sizeof(input), output, ++ ret = msi_wmi_platform_query(data, MSI_PLATFORM_GET_EC, input, sizeof(input), output, + sizeof(output)); + if (ret < 0) + return ret; + + flags = output[MSI_PLATFORM_EC_FLAGS_OFFSET]; + +- dev_dbg(&wdev->dev, "EC RAM version %lu.%lu\n", ++ dev_dbg(&data->wdev->dev, "EC RAM version %lu.%lu\n", + FIELD_GET(MSI_PLATFORM_EC_MAJOR_MASK, flags), + FIELD_GET(MSI_PLATFORM_EC_MINOR_MASK, flags)); +- dev_dbg(&wdev->dev, "EC firmware version %.28s\n", ++ dev_dbg(&data->wdev->dev, "EC firmware version %.28s\n", + &output[MSI_PLATFORM_EC_VERSION_OFFSET]); + + if (!(flags & MSI_PLATFORM_EC_IS_TIGERLAKE)) { + if (!force) + return -ENODEV; + +- dev_warn(&wdev->dev, "Loading on a non-Tigerlake platform\n"); ++ dev_warn(&data->wdev->dev, "Loading on a non-Tigerlake platform\n"); + } + + return 0; + } + +-static int msi_wmi_platform_init(struct wmi_device *wdev) ++static int msi_wmi_platform_init(struct msi_wmi_platform_data *data) + { + u8 input[32] = { 0 }; + u8 output[32]; + int ret; + +- ret = msi_wmi_platform_query(wdev, MSI_PLATFORM_GET_WMI, input, sizeof(input), output, ++ ret = msi_wmi_platform_query(data, MSI_PLATFORM_GET_WMI, input, sizeof(input), output, + sizeof(output)); + if (ret < 0) + return ret; + +- dev_dbg(&wdev->dev, "WMI interface version %u.%u\n", ++ dev_dbg(&data->wdev->dev, "WMI interface version %u.%u\n", + output[MSI_PLATFORM_WMI_MAJOR_OFFSET], + output[MSI_PLATFORM_WMI_MINOR_OFFSET]); + +@@ -381,7 +395,8 @@ static int msi_wmi_platform_init(struct + if (!force) + return -ENODEV; + +- dev_warn(&wdev->dev, "Loading despite unsupported WMI interface version (%u.%u)\n", ++ dev_warn(&data->wdev->dev, ++ "Loading despite unsupported WMI interface version (%u.%u)\n", + output[MSI_PLATFORM_WMI_MAJOR_OFFSET], + output[MSI_PLATFORM_WMI_MINOR_OFFSET]); + } +@@ -391,19 +406,31 @@ static int msi_wmi_platform_init(struct + + static int msi_wmi_platform_probe(struct wmi_device *wdev, const void *context) + { ++ struct msi_wmi_platform_data *data; + int ret; + +- ret = msi_wmi_platform_init(wdev); ++ data = devm_kzalloc(&wdev->dev, sizeof(*data), GFP_KERNEL); ++ if (!data) ++ return -ENOMEM; ++ ++ data->wdev = wdev; ++ dev_set_drvdata(&wdev->dev, data); ++ ++ ret = devm_mutex_init(&wdev->dev, &data->wmi_lock); ++ if (ret < 0) ++ return ret; ++ ++ ret = msi_wmi_platform_init(data); + if (ret < 0) + return ret; + +- ret = msi_wmi_platform_ec_init(wdev); ++ ret = msi_wmi_platform_ec_init(data); + if (ret < 0) + return ret; + +- msi_wmi_platform_debugfs_init(wdev); ++ msi_wmi_platform_debugfs_init(data); + +- return msi_wmi_platform_hwmon_init(wdev); ++ return msi_wmi_platform_hwmon_init(data); + } + + static const struct wmi_device_id msi_wmi_platform_id_table[] = { diff --git a/queue-6.14/series b/queue-6.14/series index 3435b888d0..02c0d4af8c 100644 --- a/queue-6.14/series +++ b/queue-6.14/series @@ -227,3 +227,7 @@ arm64-sysreg-add-register-fields-for-hfgwtr2_el2.patch arm64-boot-enable-el2-requirements-for-feat_pmuv3p9.patch cpufreq-reference-count-policy-in-cpufreq_update_limits.patch scripts-generate_rust_analyzer-add-ffi-crate.patch +platform-x86-alienware-wmi-wmax-add-g-mode-support-to-alienware-m16-r1.patch +platform-x86-alienware-wmi-wmax-extend-support-to-more-laptops.patch +platform-x86-msi-wmi-platform-rename-data-variable.patch +platform-x86-msi-wmi-platform-workaround-a-acpi-firmware-bug.patch