summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/wmi.c
diff options
context:
space:
mode:
authorArmin Wolf <W_Armin@gmx.de>2024-02-07 01:04:44 +0300
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2024-02-07 16:51:06 +0300
commit7f1b998a9108f7fd465039323d5fc2599b8cae77 (patch)
treefa80e8e2ff42174cb32e8d5c6e30e201b13e7f1c /drivers/platform/x86/wmi.c
parent197b980644eae1184844d451d10fe3ea51c7597d (diff)
downloadlinux-7f1b998a9108f7fd465039323d5fc2599b8cae77.tar.xz
platform/x86: wmi: Check if WMxx control method exists
Some devices like the MSI GF63-12VF contain WMI method blocks without providing the necessary WMxx ACPI control methods. Avoid creating WMI devices for such WMI method blocks since the resulting WMI device is going to be unusable. Signed-off-by: Armin Wolf <W_Armin@gmx.de> Link: https://lore.kernel.org/r/20240206220447.3102-1-W_Armin@gmx.de Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86/wmi.c')
-rw-r--r--drivers/platform/x86/wmi.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 5682c7de0394..af273623bc5b 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -958,6 +958,15 @@ static int wmi_create_device(struct device *wmi_bus_dev,
}
if (wblock->gblock.flags & ACPI_WMI_METHOD) {
+ get_acpi_method_name(wblock, 'M', method);
+ if (!acpi_has_method(device->handle, method)) {
+ dev_warn(wmi_bus_dev,
+ FW_BUG "%s method block execution control method not found\n",
+ method);
+
+ return -ENXIO;
+ }
+
wblock->dev.dev.type = &wmi_type_method;
goto out_init;
}