From nobody Sun Feb 8 23:53:08 2026 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86FDA28FFE2; Thu, 10 Apr 2025 21:29:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744320552; cv=none; b=VyzCoA2omTFpjwCr+hTtOI/SdtPUh9hC+XQ2sZhOhD+ku0Ibt3wJL4aO3+QtQsMJtpFpl1ExJNpAxUKaK0gOse0pifksu0Nwml8cWJ7B/FpG3GUKAGeRylSdAccW/SjXWx+YvR5+HfQCvCCsUN89YInQASrEc/S3op4oHQtwZZY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744320552; c=relaxed/simple; bh=QLxN7ctifJkDnCgQYaZeJXufEu1hGD/bjEkL8FGsVJ8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=G27Ozt0ST0tlJHubhJhT8w6j66Jg3cuun/NpuqUWAGtcJX6olCo8nZ4jBSzHAER/ChKyQ4061MFdn0UHdcEDn3hcFi1+pDNzQEIuhnjUPv4HbVqga2i/e2qVdcequwd6H1bRPgXJ0y1+yiCOXa8BW8mZf09NP/KQgmy0DOjr614= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b=nvKraJfN; arc=none smtp.client-ip=212.227.15.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b="nvKraJfN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1744320539; x=1744925339; i=w_armin@gmx.de; bh=FJWCKOtWx7OTTBP5s2xBxAOQliOoYe7knIn3ejxzxps=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id: MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=nvKraJfNSL042yJVZjicEb+CIIEMB6DCwulm/f9SaFijUZ226vvUFpygOPYOaQXe jI1+R9XamIbhQpu8pf2SqALTu/zxURlWmlFX0k5ds7u3aWfPcCTx4rXlenG9tt5r3 q5EvFn3rkHYNNTKACSVjg8pAs+Z2oMuvPRu2CFfxK+UlPg3qW/yS7NNdAoeI1ZVE6 hqhAKEYLDwiRe+UpAZT8sF1yhQKWCsa1kzhQi3thXoXZ54tFbdmgNNx3z247iehoI yZ9kmaw1bNEyx2gnuffC0xo3c2i6gwvrO8VM9SmlO846NRoeBbKklhY3cO3uEt8gp 97WJkcB1hgHKwroG/g== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from mx-amd-b650.fritz.box ([87.177.78.219]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MsYv3-1tB1Jw0zr1-00zpOb; Thu, 10 Apr 2025 23:28:59 +0200 From: Armin Wolf To: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, lkml@antheas.dev Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] platform/x86: msi-wmi-platform: Workaround a ACPI firmware bug Date: Thu, 10 Apr 2025 23:28:53 +0200 Message-Id: <20250410212853.334891-1-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Enc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yKsootRkHqtN8lOIVGxKrK2SrzaqQn1 BZot+Z9zMv05zDQJ5FJQgln1/gl4JiZ3VfFNIyqd7voyxGTuLJpC8Ami6M4N42wphVd7bCpmQ 47hN5tQplnN2gzZVNhMwyhxQQa23nU6i2HBQFCgUhr1aTtF52ekMXHIwr/qAWXEDsPRT7AJ94 TXqlnGPg1cw07smT0XF5aBVlKTJj7d6fBSnPsTLczgz Content-Type: text/plain; charset="utf-8" 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. Fixes: 9c0beb6b29e7 ("platform/x86: wmi: Add MSI WMI Platform driver") Tested-by: Antheas Kapenekakis Signed-off-by: Armin Wolf --- .../wmi/devices/msi-wmi-platform.rst | 4 + drivers/platform/x86/msi-wmi-platform.c | 99 ++++++++++++------- 2 files changed, 67 insertions(+), 36 deletions(-) diff --git a/Documentation/wmi/devices/msi-wmi-platform.rst b/Documentation= /wmi/devices/msi-wmi-platform.rst index 31a136942892..73197b31926a 100644 --- 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 on the subfea= ture being accessed. 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 subfeatur= e being accessed. +.. note:: + The ACPI control method responsible for handling the WMI method calls i= s not thread-safe. + This is a firmware bug that needs to be handled inside the driver itsel= f. + WMI method Get_EC() ------------------- diff --git a/drivers/platform/x86/msi-wmi-platform.c b/drivers/platform/x86= /msi-wmi-platform.c index 9b5c7f8c79b0..dc5e9878cb68 100644 --- 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 =3D 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(union acpi_obj= ect *obj, u8 *output, siz return 0; } -static int msi_wmi_platform_query(struct wmi_device *wdev, enum msi_wmi_pl= atform_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 =3D { ACPI_ALLOCATE_BUFFER, NULL }; struct acpi_buffer in =3D { @@ -147,9 +155,15 @@ static int msi_wmi_platform_query(struct wmi_device *w= dev, enum msi_wmi_platform if (!input_length || !output_length) return -EINVAL; - status =3D 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 =3D wmidev_evaluate_method(data->wdev, 0x0, method, &in, &out); + if (ACPI_FAILURE(status)) + return -EIO; + } obj =3D out.pointer; if (!obj) @@ -170,22 +184,22 @@ static umode_t msi_wmi_platform_is_visible(const void= *drvdata, enum hwmon_senso static int msi_wmi_platform_read(struct device *dev, enum hwmon_sensor_typ= es type, u32 attr, int channel, long *val) { - struct wmi_device *wdev =3D dev_get_drvdata(dev); + struct msi_wmi_platform_data *data =3D dev_get_drvdata(dev); u8 input[32] =3D { 0 }; u8 output[32]; - u16 data; + u16 value; int ret; - ret =3D msi_wmi_platform_query(wdev, MSI_PLATFORM_GET_FAN, input, sizeof(= input), output, + ret =3D msi_wmi_platform_query(data, MSI_PLATFORM_GET_FAN, input, sizeof(= input), output, sizeof(output)); if (ret < 0) return ret; - data =3D get_unaligned_be16(&output[channel * 2 + 1]); - if (!data) + value =3D get_unaligned_be16(&output[channel * 2 + 1]); + if (!value) *val =3D 0; else - *val =3D 480000 / data; + *val =3D 480000 / value; return 0; } @@ -231,7 +245,7 @@ static ssize_t msi_wmi_platform_write(struct file *fp, = const char __user *input, return ret; down_write(&data->buffer_lock); - ret =3D msi_wmi_platform_query(data->wdev, data->method, payload, data->l= ength, data->buffer, + ret =3D msi_wmi_platform_query(data->data, data->method, payload, data->l= ength, data->buffer, data->length); up_write(&data->buffer_lock); @@ -277,17 +291,17 @@ static void msi_wmi_platform_debugfs_remove(void *dat= a) debugfs_remove_recursive(dir); } -static void msi_wmi_platform_debugfs_add(struct wmi_device *wdev, struct d= entry *dir, +static void msi_wmi_platform_debugfs_add(struct msi_wmi_platform_data *drv= data, struct dentry *dir, const char *name, enum msi_wmi_platform_method method) { struct msi_wmi_platform_debugfs_data *data; struct dentry *entry; - data =3D devm_kzalloc(&wdev->dev, sizeof(*data), GFP_KERNEL); + data =3D devm_kzalloc(&drvdata->wdev->dev, sizeof(*data), GFP_KERNEL); if (!data) return; - data->wdev =3D wdev; + data->data =3D drvdata; data->method =3D method; init_rwsem(&data->buffer_lock); @@ -298,82 +312,82 @@ static void msi_wmi_platform_debugfs_add(struct wmi_d= evice *wdev, struct dentry entry =3D debugfs_create_file(name, 0600, dir, data, &msi_wmi_platform_de= bugfs_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 *da= ta) { 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 =3D debugfs_create_dir(dir_name, NULL); if (IS_ERR(dir)) return; - ret =3D devm_add_action_or_reset(&wdev->dev, msi_wmi_platform_debugfs_rem= ove, dir); + ret =3D devm_add_action_or_reset(&data->wdev->dev, msi_wmi_platform_debug= fs_remove, dir); if (ret < 0) return; for (method =3D MSI_PLATFORM_GET_PACKAGE; method <=3D MSI_PLATFORM_GET_WM= I; method++) - msi_wmi_platform_debugfs_add(wdev, dir, msi_wmi_platform_debugfs_names[m= ethod - 1], + msi_wmi_platform_debugfs_add(data, dir, msi_wmi_platform_debugfs_names[m= ethod - 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 =3D devm_hwmon_device_register_with_info(&wdev->dev, "msi_wmi_platfo= rm", wdev, + hdev =3D 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] =3D { 0 }; u8 output[32]; u8 flags; int ret; - ret =3D msi_wmi_platform_query(wdev, MSI_PLATFORM_GET_EC, input, sizeof(i= nput), output, + ret =3D msi_wmi_platform_query(data, MSI_PLATFORM_GET_EC, input, sizeof(i= nput), output, sizeof(output)); if (ret < 0) return ret; flags =3D 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] =3D { 0 }; u8 output[32]; int ret; - ret =3D msi_wmi_platform_query(wdev, MSI_PLATFORM_GET_WMI, input, sizeof(= input), output, + ret =3D 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 wmi_device *wde= v) 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 wmi_device *w= dev) static int msi_wmi_platform_probe(struct wmi_device *wdev, const void *con= text) { + struct msi_wmi_platform_data *data; int ret; - ret =3D msi_wmi_platform_init(wdev); + data =3D devm_kzalloc(&wdev->dev, sizeof(*data), GFP_KERNEL); + if (!data) + return -ENOMEM; + + data->wdev =3D wdev; + dev_set_drvdata(&wdev->dev, data); + + ret =3D devm_mutex_init(&wdev->dev, &data->wmi_lock); + if (ret < 0) + return ret; + + ret =3D msi_wmi_platform_init(data); if (ret < 0) return ret; - ret =3D msi_wmi_platform_ec_init(wdev); + ret =3D 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[] =3D { -- 2.39.5