[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <371d4109-a3bb-4c3b-802f-4ec27a945c99@amd.com>
Date: Tue, 28 May 2024 16:16:41 -0500
From: Mario Limonciello <mario.limonciello@....com>
To: Luke Jones <luke@...nes.dev>, Hans de Goede <hdegoede@...hat.com>,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Cc: corentin.chary@...il.com, platform-driver-x86@...r.kernel.org,
linux-kernel@...r.kernel.org, richard@...hsie.com
Subject: Re: [PATCH 8/9] platform/x86: asus-wmi: add apu_mem setting
>> For any "new" attributes it's better to put them in that API than code
>> duplication of the BIOS attributes API as well as a random sysfs file
>> API that you can never discard.
>
> Do you mean the firmware_attributes API? If so, I'm not opposed to adding all the existing ROG attributes to it also.
>
> If I'm understanding the docs correctly, for example this apu_mem attr would then become:
> - /sys/class/firmware-attributes/asus-bios/attributes/apu_mem/type
> - /sys/class/firmware-attributes/*/attributes/apu_mem/current_value
> - /sys/class/firmware-attributes/*/attributes/apu_mem/default_value
> - /sys/class/firmware-attributes/*/attributes/apu_mem/display_name
> - /sys/class/firmware-attributes/*/attributes/apu_mem/possible_values
> - ..etc
>
> That's absolutely much better than what I've been doing and I wish I'd known about it sooner.
Yup! And even better "fwupdmgr get-bios-setting" and "fwupdmgr
set-bios-setting" [1] will work with bash completion too.
If you want to build a GUI around it, it could use the fwupd dbus
interface for getting those settings and manipulating them. The dbus
interface policy is protected by PK.
>
> So if I go ahead and convert all the new attr to this are there any issues with also converting much of the previous attr? And I'm aware of "don't break userspace" so really I'm a bit unsure how best to manage that (would a new module be better here also? "asus-bios.c" perhaps).
>
> What I don't want is a split between platform and firmware_attributes.
>
My personal thought is add everything to the new API and then hide the
"old" interface behind some boolean Kconfig option that defaults to
disabled. If someone enables it then when it's "used" (IE read from /
written to) then do something like a pr_warn_once() that it's a
deprecated interface and it will go away. Wait until next LTS kernel,
and then rip it out after that.
Need Hans and/or Ilpo agree to make with that though before you spend
too much effort on it though.
[1] https://fwupd.github.io/libfwupdplugin/bios-settings.html
Powered by blists - more mailing lists