]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
platform/x86: wmi: Fix WMI device naming issue
authorArmin Wolf <W_Armin@gmx.de>
Tue, 10 Jun 2025 05:55:26 +0000 (07:55 +0200)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Fri, 13 Jun 2025 09:33:33 +0000 (12:33 +0300)
commit73f0f2b52c5ea67b3140b23f58d8079d158839c8
tree77e91b9eefcd8e411cf80bfd83f5c453f2a941de
parentc9de2e5c15cba9e9be7fd124a74b9067560d4746
platform/x86: wmi: Fix WMI device naming issue

When multiple WMI devices with the same GUID are present
inside a given system, the WMI driver core might fail to
register all of them.

Consider the following scenario:

WMI devices (<GUID>[-<ID>]):
05901221-D566-11D1-B2F0-00A0C9062910 (on PNP0C14:00)
05901221-D566-11D1-B2F0-00A0C9062910-1 (on PNP0C14:01)

If the WMI core driver somehow unbinds from PNP0C14:00, the following
will happen upon rebinding:

1. The WMI driver core counts all registered WMI devices with a GUID
   of 05901221-D566-11D1-B2F0-00A0C9062910 (count: 1).

2. The new WMI device will be named
   "05901221-D566-11D1-B2F0-00A0C9062910-1" because another device
   with the same GUID is already registered (on PNP0C14:01).

3. The new WMI device cannot be registered due to a name conflict.

Use a IDA when building the WMI device name to avoid such name
collisions by ensuring that a given WMI device ID is not reused.

Userspace applications using udev for WMI device detection are not
impacted by this change. Additionally userspace applications that do
fully support the existing naming scheme are also not impacted. Only
userspace applications using hardcoded sysfs paths will break.
Introduce a kconfig option for restoring the old naming scheme to
give developers time to fix any compatibility issues.

Tested on a Asus Prime B650-Plus.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20250610055526.23688-2-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>
drivers/platform/x86/Kconfig
drivers/platform/x86/wmi.c