Skip to content

Commit cf0b812

Browse files
Wer-Wolfij-intel
authored andcommitted
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 <[email protected]> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220246 Tested-by: Dmytro Bagrii <[email protected]> Fixes: 656f096 ("platform/x86: wmi: Rework WCxx/WExx ACPI method handling") Signed-off-by: Armin Wolf <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent d07143b commit cf0b812

File tree

1 file changed

+11
-5
lines changed
  • drivers/platform/x86

1 file changed

+11
-5
lines changed

drivers/platform/x86/wmi.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,16 +177,22 @@ static int wmi_device_enable(struct wmi_device *wdev, bool enable)
177177
acpi_handle handle;
178178
acpi_status status;
179179

180-
if (!(wblock->gblock.flags & ACPI_WMI_EXPENSIVE))
181-
return 0;
182-
183180
if (wblock->dev.dev.type == &wmi_type_method)
184181
return 0;
185182

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+
*/
187189
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+
189194
get_acpi_method_name(wblock, 'C', method);
195+
}
190196

191197
/*
192198
* Not all WMI devices marked as expensive actually implement the

0 commit comments

Comments
 (0)