On Fri, Feb 28, 2025 at 9:02 AM Mario Limonciello <superm1@xxxxxxxxxx> wrote: > > From: Mario Limonciello <mario.limonciello@xxxxxxx> > > When two drivers provide platform profile handlers but use different > strings to mean (essentially) the same thing the legacy interface won't > export them because it only shows profiles common to multiple drivers. > > This causes an unexpected behavior to people who have upgraded from an > earlier kernel because if multiple drivers have bound platform profile > handlers they might not be able to access profiles they were expecting. > > Introduce a concept of a "hidden choice" that drivers can register and > the platform profile handler code will utilize when using the legacy > interface. > > There have been some other attempts at solving this issue in other ways. > This serves as an alternative to those attempts. > > Link: https://lore.kernel.org/platform-driver-x86/e64b771e-3255-42ad-9257-5b8fc6c24ac9@xxxxxx/T/#t > Link: https://lore.kernel.org/platform-driver-x86/CAGwozwF-WVEgiAbWbRCiUaXf=BVa3KqmMJfs06trdMQHpTGmjQ@xxxxxxxxxxxxxx/T/#m2f3929e2d4f73cc0eedd14738170dad45232fd18 > Cc: Antheas Kapenekakis <lkml@xxxxxxxxxxx> > Cc: "Luke D. Jones" <luke@xxxxxxxxxx> > > Mario Limonciello (3): > ACPI: platform_profile: Add support for hidden choices > platform/x86/amd: pmf: Add 'quiet' to hidden choices > platform/x86/amd: pmf: Add balanced-performance to hidden choices > > drivers/acpi/platform_profile.c | 94 +++++++++++++++++++++++------- > drivers/platform/x86/amd/pmf/sps.c | 11 ++++ > include/linux/platform_profile.h | 3 + > 3 files changed, 87 insertions(+), 21 deletions(-) > > -- > 2.43.0 > Everything seems to be working as intended. I applied these patches on top of my lenovo-wmi series modified to always show balanced-performance and with quiet as the lowest profile. Testing was done on the Legion Go. Results: $ cat /sys/firmware/acpi/platform_profile_choices quiet balanced balanced-performance performance $ for f in *; do cat $f/name; cat $f/choices; done; lenovo-wmi-gamezone quiet balanced balanced-performance performance custom amd-pmf low-power balanced performance $ echo quiet | sudo tee /sys/firmware/acpi/platform_profile quiet $ for f in *; do cat $f/name; cat $f/profile; done; lenovo-wmi-gamezone quiet amd-pmf quiet $ echo balanced-performance | sudo tee /sys/firmware/acpi/platform_profile balanced-performance $ for f in *; do cat $f/name; cat $f/profile; done; lenovo-wmi-gamezone balanced-performance amd-pmf balanced-performance $ echo low-power | sudo tee /sys/firmware/acpi/platform_profile low-power tee: /sys/firmware/acpi/platform_profile: Operation not supported $ for f in *; do cat $f/name; cat $f/profile; done; lenovo-wmi-gamezone balanced-performance amd-pmf balanced-performance Tested-by: Derek J. Clark <derekjohn.clark@xxxxxxxxx>