Skip to contentSkip to conversation

platform/x86: wmi: Skip blocks with zero instances

PATCH In review Armin Wolf 2 participants 2 messages Nov 29, 2023 – Nov 30, 2023 x86 platform drivers

lore
Share & tools
lore

Armin Wolf

author
#0 lore raw

PATCH v2 1/1 platform/x86: wmi: Skip blocks with zero instances

Some machines like the HP Omen 17 ck2000nf contain WMI blocks with zero instances, so any WMI driver which tries to handle the associated WMI device will fail.
Skip such WMI blocks to avoid confusing any WMI drivers.

Fixes bff431e49ff5 ("ACPI: WMI: Add ACPI-WMI mapping driver")

---
Changes since v2:
- add Fixes tag

---
 drivers/platform/x86/wmi.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/platform/x86/wmi.c +5 -0
index cb7e74f2b009..4f94e4b117f1 100644
@@ -1346,6 +1346,11 @@ static int parse_wdg(struct device *wmi_bus_dev, struct platform_device *pdev)
 		if (debug_dump_wdg)
 			wmi_dump_wdg(&gblock[i]);
 
+		if (!gblock[i].instance_count) {
+			dev_info(wmi_bus_dev, FW_INFO "%pUL has zero instances\n", &gblock[i].guid);
+			continue;
+		}
+
 		if (guid_already_parsed_for_legacy(device, &gblock[i].guid))
 			continue;
 

--
2.39.2

maintainer
#1 lore raw
Quoted 6 lines · Armin Wolf

Some machines like the HP Omen 17 ck2000nf contain WMI blocks with zero instances, so any WMI driver which tries to handle the associated WMI device will fail.
Skip such WMI blocks to avoid confusing any WMI drivers.

Thank you for your contribution, it has been applied to my local review-ilpo branch. Note it will show up in the public platform-drivers-x86/review-ilpo branch only once I've pushed my local branch there, which might take a while.

The list of commits applied:
[1/1] platform/x86: wmi: Skip blocks with zero instances

      commit: cbf54f37600e874d82886aa3b2f471778cae01ce

--
i.