]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
platform/x86: wmi: Allow duplicate GUIDs for drivers that use struct wmi_driver
authorMario Limonciello <mario.limonciello@amd.com>
Mon, 29 Aug 2022 20:14:59 +0000 (15:14 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Dec 2023 17:36:33 +0000 (18:36 +0100)
commit29783a17a30acbb0e03d895f0e6f0457e6029f26
tree2e45aaa10233d98f9bad59136607426005983f8f
parent0f06d9bd2ef8cbfe39c4fcbd1de412ded71f74ef
platform/x86: wmi: Allow duplicate GUIDs for drivers that use struct wmi_driver

[ Upstream commit 134038b075cb1dae21623499d765973d286ac94a ]

The WMI subsystem in the kernel currently tracks WMI devices by
a GUID string not by ACPI device.  The GUID used by the `wmi-bmof`
module however is available from many devices on nearly every machine.

This originally was thought to be a bug, but as it happens on most
machines it is a design mistake.  It has been fixed by tying an ACPI
device to the driver with struct wmi_driver. So drivers that have
moved over to struct wmi_driver can actually support multiple
instantiations of a GUID without any problem.

Add an allow list into wmi.c for GUIDs that the drivers that are known
to use struct wmi_driver.  The list is populated with `wmi-bmof` right
now. The additional instances of that in sysfs with be suffixed with -%d

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20220829201500.6341-1-mario.limonciello@amd.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Stable-dep-of: cbf54f37600e ("platform/x86: wmi: Skip blocks with zero instances")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/wmi.c