Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

platform/x86: wmi: Fix WMI event enablement

It turns out that the Windows WMI-ACPI driver always enables/disables
WMI events regardless of whether they are marked as expensive or not.
This finding is further reinforced when reading the documentation of
the WMI_FUNCTION_CONTROL_CALLBACK callback used by Windows drivers
for enabling/disabling WMI devices:

The DpWmiFunctionControl routine enables or disables
notification of events, and enables or disables data
collection for data blocks that the driver registered
as expensive to collect.

Follow this behavior to fix the WMI event used for reporting hotkey
events on the Dell Latitude 5400 and likely many more devices.

Reported-by: Dmytro Bagrii <dimich.dmb@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220246
Tested-by: Dmytro Bagrii <dimich.dmb@gmail.com>
Fixes: 656f0961d126 ("platform/x86: wmi: Rework WCxx/WExx ACPI method handling")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20250619221440.6737-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>

authored by

Armin Wolf and committed by
Ilpo Järvinen
cf0b8125 d07143b5

+11 -5
+11 -5
drivers/platform/x86/wmi.c
··· 177 177 acpi_handle handle; 178 178 acpi_status status; 179 179 180 - if (!(wblock->gblock.flags & ACPI_WMI_EXPENSIVE)) 181 - return 0; 182 - 183 180 if (wblock->dev.dev.type == &wmi_type_method) 184 181 return 0; 185 182 186 - if (wblock->dev.dev.type == &wmi_type_event) 183 + if (wblock->dev.dev.type == &wmi_type_event) { 184 + /* 185 + * Windows always enables/disables WMI events, even when they are 186 + * not marked as being expensive. We follow this behavior for 187 + * compatibility reasons. 188 + */ 187 189 snprintf(method, sizeof(method), "WE%02X", wblock->gblock.notify_id); 188 - else 190 + } else { 191 + if (!(wblock->gblock.flags & ACPI_WMI_EXPENSIVE)) 192 + return 0; 193 + 189 194 get_acpi_method_name(wblock, 'C', method); 195 + } 190 196 191 197 /* 192 198 * Not all WMI devices marked as expensive actually implement the