platform-driver-x86.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bug 216460] New: lenovo-thinklmi doesn't export a 'type' attribute and doesn't populate possible_values properly
@ 2022-09-07 18:42 bugzilla-daemon
  2022-09-07 18:43 ` [Bug 216460] " bugzilla-daemon
  0 siblings, 1 reply; 2+ messages in thread
From: bugzilla-daemon @ 2022-09-07 18:42 UTC (permalink / raw)
  To: platform-driver-x86

https://bugzilla.kernel.org/show_bug.cgi?id=216460

            Bug ID: 216460
           Summary: lenovo-thinklmi doesn't export a 'type' attribute and
                    doesn't populate possible_values properly
           Product: Drivers
           Version: 2.5
    Kernel Version: 6.0-rc3
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Platform_x86
          Assignee: drivers_platform_x86@kernel-bugs.osdl.org
          Reporter: mario.limonciello@amd.com
        Regression: No

The firmware-attributes documentation (
https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-firmware-attributes)
indicates that all drivers that support firmware-attributes need to support the
'type' attribute.

This is important for userspace software to know how to interact with the
driver.  

fwupd 1.8.4 added support for the firmware-attributes class API, but since
lenovo-thinklmi doesn't meet it shows the following error on every boot.

KERNEL BUG: 'type' attribute not exported: (failed to load type: Failed to open
file “/sys/class/firmware-attributes/thinklmi/attributes/MCRUSBHeader/type”: No
such file or directory)

A workaround has been landed in fwupd to avoid this attribute and hardcode the
known behavior of the current driver when it finds it.

It seems like all the attributes are actually "enumeration", so the
lenovo-thinklmi kernel driver should probably just export a type sysfs file
with "enumeration" hardcoded for all attributes.

Also though, the possible_values key is not populated either.  Instead the
values are put into the "current_value" string.  On a Lenovo P620 the following
happens:

$ sudo cat
/sys/class/firmware-attributes/thinklmi/attributes/NUMA/current_value
Auto;[Optional:NPS1,NPS2,NPS4,Auto]
$ sudo cat
/sys/class/firmware-attributes/thinklmi/attributes/NUMA/possible_values
cat: /sys/class/firmware-attributes/thinklmi/attributes/NUMA/possible_values:
Operation not supported

That is the userspace software tears apart the current_value string and instead
puts it into what the possible_values are.  This should be the responsibility
of the kernel driver.  Even if the firwmare returns all that in current_value,
the kernel driver should be doing the splitting so that userspace doesn't need
to carry quirks for different kernel drivers behaving differently.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug 216460] lenovo-thinklmi doesn't export a 'type' attribute and doesn't populate possible_values properly
  2022-09-07 18:42 [Bug 216460] New: lenovo-thinklmi doesn't export a 'type' attribute and doesn't populate possible_values properly bugzilla-daemon
@ 2022-09-07 18:43 ` bugzilla-daemon
  0 siblings, 0 replies; 2+ messages in thread
From: bugzilla-daemon @ 2022-09-07 18:43 UTC (permalink / raw)
  To: platform-driver-x86

https://bugzilla.kernel.org/show_bug.cgi?id=216460

Mario Limonciello (AMD) (mario.limonciello@amd.com) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|drivers_platform_x86@kernel |markpearson@lenovo.com
                   |-bugs.osdl.org              |

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-07 18:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-07 18:42 [Bug 216460] New: lenovo-thinklmi doesn't export a 'type' attribute and doesn't populate possible_values properly bugzilla-daemon
2022-09-07 18:43 ` [Bug 216460] " bugzilla-daemon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).