[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFqHKT=brdboD_=kfCHqPza+gbHvAicWnY9vcCDhPb3YBLzTaA@mail.gmail.com>
Date: Thu, 30 Oct 2025 18:19:56 -0700
From: Derek John Clark <derekjohn.clark@...il.com>
To: Mario Limonciello <superm1@...nel.org>
Cc: Hans de Goede <hdegoede@...hat.com>, Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
Armin Wolf <W_Armin@....de>, Len Brown <lenb@...nel.org>,
"Rafael J . Wysocki" <rafael@...nel.org>, Jonathan Corbet <corbet@....net>, Zhixin Zhang <zhangzx36@...ovo.com>,
Mia Shao <shaohz1@...ovo.com>, Mark Pearson <mpearson-lenovo@...ebb.ca>,
"Pierre-Loup A . Griffais" <pgriffais@...vesoftware.com>, Kurt Borja <kuurtb@...il.com>,
platform-driver-x86@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org
Subject: Re: [PATCH 3/3] platform/x86: lenovo-wmi-gamezone Use explicit allow list
On Sun, Oct 26, 2025 at 2:19 PM Mario Limonciello <superm1@...nel.org> wrote:
>
>
>
> On 10/26/25 2:22 PM, Derek J. Clark wrote:
> > On October 26, 2025 10:50:40 AM PDT, Mario Limonciello <superm1@...nel.org> wrote:
> >>
> >>
> >> On 10/26/25 3:12 AM, Derek J. Clark wrote:
> >>> The stubbed extreme mode issue seems to be more prevalent than previously
> >>> thought with multiple users having reported BIOS bugs from setting
> >>> "performance" when using userspace tools such as PPD. To avoid this ever
> >>> being possible, make enabling extreme mode an explicit allow list instead.
> >>> These users will still be able to set extreme mode using the Fn+Q keyboard
> >>> chord, so no functionality is lost. Currently no models have been
> >>> validated with extreme mode.
> >>
Hi Mario.
> >> So what exactly happens when a user uses FN+Q to change to extreme mode but it's now in the allow list? Does it report as "custom" mode?
The affected user that originally reported this issue to me was able
to test. With the series applied he booted into Linux after setting
extreme in Windows. Both the legacy firmware interface and the new
class interface report "extreme" despite it not being available in the
profile options. He also reported expected behavior from the power
slider in KDE's PPD widget.
> > It turns out I got a correction after posting this that I'll need to include for v2. Extreme is never actually set using Fn+Q and can only be set in software. In that case, functionality is lost (though extreme should match custom mode default values, so only slightly). The only chance this could happen realistically would be if a user switched from windows in extreme mode and then booted windows, since the setting is retained.
I got more amplifying information on this that explains the back and
forth confusion. In windows there is a toggle in the userspace UI that
can add or remove the extreme profile from the Fn+Q macro cycle, so
sometimes this scenario will be possible and sometimes not. I don't
see anything in the documentation for extreme mode toggling
specifically, but there is a toggle for custom mode in Fn+Q so that
could be a translation error or a mistake in the docs. I'll need to
get amplification from Lenovo on this, but adding it will also depend
on the series by Rong that adds capdata00 so I'll forgo adding the
toggle functionality in this series. Once Rong's series is accepted
and I can get amplification from Lenovo I'll submit another series to
add it as an attribute in the lenovo-wmi-other firmware-attributes.
> Is retaining the setting across reboots/OSes the "expected" behavior?
> Or should it be resetting to balanced at startup?
> If you set it explicitly to balanced when the module is loaded that
> would help to alleviate any of these corner cases.
This is expected behavior, and it can be set in BIOS manually as well.
I don't think changing this at driver load is necessary and would
probably be confusing to users who expect it to remain consistent.
> >
> > TBS, I'm asking some folks to test exactly that situation so we can know definitely. My assumption was that it would report extreme normally but not be setable.
> >
> >> I feel like this is going to turn into an impedance mismatch. I'm leaning it's better to just expose extreme mode so that userspace knows what's actually going on.
> >
> > It's possible, I'll wait for confirmation of the behavior from someone with the affected hardware.
>
> OK.
>
> >
> > Thanks,
> > Derek
> >
> >> I feel the bug situation will actually improve because PPD and Tuned have no idea what extreme mode means so it won't be "easy" to get into it. This at least will allow discovery of BIOS bugs as well that can then get reported and fixed in BIOS.
I'm leaning towards the original deny list now because of this as
well. I'll drop patch 3 for v2 unless Armin or Ilpo have a
disagreement.
Thanks,
Derek
> >>
> >>>
> >>> Signed-off-by: Derek J. Clark <derekjohn.clark@...il.com>
> >>> ---
> >>> .../wmi/devices/lenovo-wmi-gamezone.rst | 10 +++---
> >>> drivers/platform/x86/lenovo/wmi-gamezone.c | 33 ++-----------------
> >>> 2 files changed, 8 insertions(+), 35 deletions(-)
> >>>
> >>> diff --git a/Documentation/wmi/devices/lenovo-wmi-gamezone.rst b/Documentation/wmi/devices/lenovo-wmi-gamezone.rst
> >>> index 6c908f44a08e..79051dc62022 100644
> >>> --- a/Documentation/wmi/devices/lenovo-wmi-gamezone.rst
> >>> +++ b/Documentation/wmi/devices/lenovo-wmi-gamezone.rst
> >>> @@ -31,11 +31,11 @@ The following platform profiles are supported:
> >>> Extreme
> >>> ~~~~~~~~~~~~~~~~~~~~
> >>> Some newer Lenovo "Gaming Series" laptops have an "Extreme Mode" profile
> >>> -enabled in their BIOS.
> >>> -
> >>> -For some newer devices the "Extreme Mode" profile is incomplete in the BIOS
> >>> -and setting it will cause undefined behavior. A BIOS bug quirk table is
> >>> -provided to ensure these devices cannot set "Extreme Mode" from the driver.
> >>> +enabled in their BIOS. For some newer devices the "Extreme Mode" profile
> >>> +is incomplete in the BIOS and setting it will cause undefined behavior. To
> >>> +prevent ever setting this on unsupported hardware, an explicit allow quirk
> >>> +table is provided with all validated devices. This ensures only fully
> >>> +supported devices can set "Extreme Mode" from the driver.
> >>> Custom Profile
> >>> ~~~~~~~~~~~~~~
> >>> diff --git a/drivers/platform/x86/lenovo/wmi-gamezone.c b/drivers/platform/x86/lenovo/wmi-gamezone.c
> >>> index faabbd4657bd..0488162a7194 100644
> >>> --- a/drivers/platform/x86/lenovo/wmi-gamezone.c
> >>> +++ b/drivers/platform/x86/lenovo/wmi-gamezone.c
> >>> @@ -47,10 +47,6 @@ struct quirk_entry {
> >>> bool extreme_supported;
> >>> };
> >>> -static struct quirk_entry quirk_no_extreme_bug = {
> >>> - .extreme_supported = false,
> >>> -};
> >>> -
> >>> /**
> >>> * lwmi_gz_mode_call() - Call method for lenovo-wmi-other driver notifier.
> >>> *
> >>> @@ -241,31 +237,8 @@ static int lwmi_gz_profile_set(struct device *dev,
> >>> return 0;
> >>> }
> >>> +/* Explicit allow list */
> >>> static const struct dmi_system_id fwbug_list[] = {
> >>> - {
> >>> - .ident = "Legion Go 8APU1",
> >>> - .matches = {
> >>> - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> >>> - DMI_MATCH(DMI_PRODUCT_VERSION, "Legion Go 8APU1"),
> >>> - },
> >>> - .driver_data = &quirk_no_extreme_bug,
> >>> - },
> >>> - {
> >>> - .ident = "Legion Go S 8APU1",
> >>> - .matches = {
> >>> - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> >>> - DMI_MATCH(DMI_PRODUCT_VERSION, "Legion Go S 8APU1"),
> >>> - },
> >>> - .driver_data = &quirk_no_extreme_bug,
> >>> - },
> >>> - {
> >>> - .ident = "Legion Go S 8ARP1",
> >>> - .matches = {
> >>> - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
> >>> - DMI_MATCH(DMI_PRODUCT_VERSION, "Legion Go S 8ARP1"),
> >>> - },
> >>> - .driver_data = &quirk_no_extreme_bug,
> >>> - },
> >>> {},
> >>> };
> >>> @@ -278,7 +251,7 @@ static const struct dmi_system_id fwbug_list[] = {
> >>> * Anything version 5 or lower does not. For devices with a version 6 or
> >>> * greater do a DMI check, as some devices report a version that supports
> >>> * extreme mode but have an incomplete entry in the BIOS. To ensure this
> >>> - * cannot be set, quirk them to prevent assignment.
> >>> + * cannot be set, quirk them to enable assignment.
> >>> *
> >>> * Return: bool.
> >>> */
> >>> @@ -292,7 +265,7 @@ static bool lwmi_gz_extreme_supported(int profile_support_ver)
> >>> dmi_id = dmi_first_match(fwbug_list);
> >>> if (!dmi_id)
> >>> - return true;
> >>> + return false;
> >>> quirks = dmi_id->driver_data;
> >>>
> >>
> >
>
Powered by blists - more mailing lists