platform/x86: wmi: Use ACPI device name in netlink event
PATCH v2 1/1 platform/x86: wmi: Use ACPI device name in netlink event
The device name inside the ACPI netlink event is limited to 15 characters, so the WMI device name will get truncated.
This can be observed with kacpimon when receiving an event from WMI device "9DBB5994-A997-11DA-B012-B622A1EF5492":
netlink: 9DBB5994-A997- 000000d0 00000000
Fix this by using the shorter device name from the ACPI bus device instead. This still allows users to uniquely identify the WMI device by using the notify id (0xd0).
---
Changes since v1:
- use acpi_dev_name() helper function
--- drivers/platform/x86/wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/wmi.c +1 -1
@@ -1202,7 +1202,7 @@ static int wmi_notify_device(struct device *dev, void *data) }acpi_bus_generate_netlink_event (wblock->acpi_device->pnp.device_class, -dev_name (&wblock->dev.dev), *event,0 ); +acpi_dev_name (wblock->acpi_device), *event,0 );return -EBUSY ; }
--
2.39.2
Hi Armin,
Quoted 8 lines · Armin Wolf
The device name inside the ACPI netlink event is limited to 15 characters, so the WMI device name will get truncated.
This can be observed with kacpimon when receiving an event from WMI device "9DBB5994-A997-11DA-B012-B622A1EF5492":
netlink: 9DBB5994-A997- 000000d0 00000000
Quoted 8 lines
Fix this by using the shorter device name from the ACPI bus device instead. This still allows users to uniquely identify the WMI device by using the notify id (
0xd0).Signed-off-by Armin Wolf <[email protected]>---
Changes since v1:
- useacpi_dev_name()helper function
I'm a bit divided on this patch. I agree the new way of doing things is better, but technically this is a bit of a userspace API break.
I guess we could hope that nothing depends on the old netlink API format / name but I'm not sure we can rely on that ...
Ilpo, Andy do you have any opinion on this ?
Regards,
Hans
Quoted 20 lines
--- drivers/platform/x86/wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/platform/x86/wmi.c +1
-2@@ -1202,7 +1202,7 @@ static int wmi_notify_device(struct device *dev, void *data) }acpi_bus_generate_netlink_event (wblock->acpi_device->pnp.device_class, -dev_name (&wblock->dev.dev), *event,0 ); +acpi_dev_name (wblock->acpi_device), *event,0 );return -EBUSY ; } --2.39.2
Ilpo Järvinen
maintainerQuoted 18 lines · Hans de Goede
Quoted 8 lines · Armin Wolf
The device name inside the ACPI netlink event is limited to 15 characters, so the WMI device name will get truncated.
This can be observed with kacpimon when receiving an event from WMI device "9DBB5994-A997-11DA-B012-B622A1EF5492":
netlink: 9DBB5994-A997- 000000d0 00000000Quoted 8 lines
Fix this by using the shorter device name from the ACPI bus device instead. This still allows users to uniquely identify the WMI device by using the notify id (
0xd0).Signed-off-by Armin Wolf <[email protected]>---
Changes since v1:
- useacpi_dev_name()helper function
Quoted 8 lines
I'm a bit divided on this patch. I agree the new way of doing things is better, but technically this is a bit of a userspace API break.
I guess we could hope that nothing depends on the old netlink API format / name but I'm not sure we can rely on that ...
Ilpo, Andy do you have any opinion on this ?
Hi Armin,
Have you tried to conduct debian code search to find the code using this?
Signature · 1 line
i.
Quoted 21 lines
Quoted 20 lines
--- drivers/platform/x86/wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/platform/x86/wmi.c +1
-2@@ -1202,7 +1202,7 @@ static int wmi_notify_device(struct device *dev, void *data) }acpi_bus_generate_netlink_event (wblock->acpi_device->pnp.device_class, -dev_name (&wblock->dev.dev), *event,0 ); +acpi_dev_name (wblock->acpi_device), *event,0 );return -EBUSY ; } --2.39.2
Am 22.01.24 um 13:47 schrieb Ilpo Järvinen:
Quoted 22 lines · Hans de Goede
Quoted 21 lines · Armin Wolf
Quoted 8 lines
The device name inside the ACPI netlink event is limited to 15 characters, so the WMI device name will get truncated.
This can be observed with kacpimon when receiving an event from WMI device "9DBB5994-A997-11DA-B012-B622A1EF5492":
netlink: 9DBB5994-A997- 000000d0 00000000Quoted 8 lines
Fix this by using the shorter device name from the ACPI bus device instead. This still allows users to uniquely identify the WMI device by using the notify id (
0xd0).Signed-off-by Armin Wolf <[email protected]>---
Changes since v1:
- useacpi_dev_name()helper functionI'm a bit divided on this patch. I agree the new way of doing things is better, but technically this is a bit of a userspace API break.
Quoted 8 lines
Quoted 4 lines
I guess we could hope that nothing depends on the old netlink API format / name but I'm not sure we can rely on that ...
Ilpo, Andy do you have any opinion on this ?
Hi Armin,
Have you tried to conduct debian code search to find the code using this?
I did, but i found nothing.
I am also preparing to properly initialize the device_class field in another patch, and this also has the potential of breaking userspace if some users created custom acpid configs to listen to those events.
I think we can revert those changes anytime if someones turns out to be actually depending on them.
Armin Wolf
Hans de Goede
Reviewed-byHi,
Quoted 32 lines · Armin Wolf
Am 22.01.24 um 13:47 schrieb Ilpo Järvinen:
Quoted 22 lines · Hans de Goede
Quoted 21 lines · Armin Wolf
Quoted 8 lines
The device name inside the ACPI netlink event is limited to 15 characters, so the WMI device name will get truncated.
This can be observed with kacpimon when receiving an event from WMI device "9DBB5994-A997-11DA-B012-B622A1EF5492":
netlink: 9DBB5994-A997-
000000d000000000Quoted 8 lines
Fix this by using the shorter device name from the ACPI bus device instead. This still allows users to uniquely identify the WMI device by using the notify id (
0xd0).Signed-off-by Armin Wolf <[email protected]>---
Changes since v1:
- useacpi_dev_name()helper functionI'm a bit divided on this patch. I agree the new way of doing things is better, but technically this is a bit of a userspace API break.
Quoted 8 lines
Quoted 4 lines
I guess we could hope that nothing depends on the old netlink API format / name but I'm not sure we can rely on that ...
Ilpo, Andy do you have any opinion on this ?
Hi Armin,
Have you tried to conduct debian code search to find the code using this?
Quoted 8 lines
I did, but i found nothing.
I am also preparing to properly initialize the
device_classfield in another patch, and this also has the potential of breaking userspace if some users created custom acpid configs to listen to those events.I think we can revert those changes anytime if someones turns out to be actually depending on them.
Based on the above I'm willing to go ahead with these changes, with the note that we need to be prepared to revert this immediately if we get any reports if this breaking userspace.
Given the (unlikely) potential breakage I think it would be good to get this change into linux-next soon for maximum testing.
Regards,
Hans
Ilpo Järvinen
maintainerQuoted 9 lines · Armin Wolf
The device name inside the ACPI netlink event is limited to 15 characters, so the WMI device name will get truncated.
This can be observed with kacpimon when receiving an event from WMI device "9DBB5994-A997-11DA-B012-B622A1EF5492":
netlink: 9DBB5994-A997- 000000d0 00000000[...]
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: Use ACPI device name in netlink event
commit: 3f399b5d7189bcb608c75abc85fe39f7a5509cfa
--
i.