* [PATCH 0/3] Add extreme platform profile
@ 2025-10-26 8:12 Derek J. Clark
2025-10-26 8:12 ` [PATCH 1/3] acpi: platform_profile - Add Extreme profile option Derek J. Clark
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Derek J. Clark @ 2025-10-26 8:12 UTC (permalink / raw)
To: Hans de Goede, Ilpo Järvinen, Armin Wolf, Len Brown,
Rafael J . Wysocki, Jonathan Corbet
Cc: Mario Limonciello, Zhixin Zhang, Mia Shao, Mark Pearson,
Pierre-Loup A . Griffais, Kurt Borja, Derek J . Clark,
platform-driver-x86, linux-doc, linux-kernel, linux-acpi
This series adds a new "extreme" platform profile mode and uses it for
the lenovo-wmi-gamezone driver. It also prevents bugs that are being
reported by some users by switching the current deny list to an allow
list. Currently there are no validated models, so I've removeed the
unused quirk until something is added to avoid the warning.
On some Lenovo Legion devices there is a thermal mode called extreme
that corresponds to setting ppt/spl vlaues to the maximum achievable by
the cooling solution. This correlates strongly with an overall power draw
that exceeds the DC power draw capability of the internal battery. This
mode is stubbed in multiple devices that incorrectly report the
capability as supported. Previously this mode was quirked out for known
problem models, but I've since got multiple bug reports of additional
models that cause issues. Additionally, this mode being mapped to
performance when extreme mode is detected as supported, with the actual
performance mode being set to balanced-performance, has led to some
misinformation being promulgated that performance is always a bad
setting in Linux for these devices. There is also some confusion that
the mode labeled performance in userspace, which corresponds to a red
LED in Windows, shows as purple when set using the hardware extreme mode.
I'll also note that as the hard limits are refreshed when on AC or DC by
the ACPI notifier of lenovo-wmi-other method driver, no special handling
of the battery is needed for safety limiting this mode.
Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.com>
Derek J. Clark (3):
acpi: platform_profile - Add Extreme profile option
platform/x86: lenovo-wmi-gamezone Use Extreme vice
balanced-performance
platform/x86: lenovo-wmi-gamezone Use explicit allow list
.../ABI/testing/sysfs-class-platform-profile | 2 +
.../wmi/devices/lenovo-wmi-gamezone.rst | 18 +++----
drivers/acpi/platform_profile.c | 1 +
drivers/platform/x86/lenovo/wmi-gamezone.c | 51 ++++---------------
include/linux/platform_profile.h | 1 +
5 files changed, 21 insertions(+), 52 deletions(-)
--
2.51.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/3] acpi: platform_profile - Add Extreme profile option
2025-10-26 8:12 [PATCH 0/3] Add extreme platform profile Derek J. Clark
@ 2025-10-26 8:12 ` Derek J. Clark
2025-10-26 17:53 ` Mario Limonciello
2025-11-03 15:58 ` Rafael J. Wysocki
2025-10-26 8:12 ` [PATCH 2/3] platform/x86: lenovo-wmi-gamezone Use Extreme vice balanced-performance Derek J. Clark
2025-10-26 8:12 ` [PATCH 3/3] platform/x86: lenovo-wmi-gamezone Use explicit allow list Derek J. Clark
2 siblings, 2 replies; 12+ messages in thread
From: Derek J. Clark @ 2025-10-26 8:12 UTC (permalink / raw)
To: Hans de Goede, Ilpo Järvinen, Armin Wolf, Len Brown,
Rafael J . Wysocki, Jonathan Corbet
Cc: Mario Limonciello, Zhixin Zhang, Mia Shao, Mark Pearson,
Pierre-Loup A . Griffais, Kurt Borja, Derek J . Clark,
platform-driver-x86, linux-doc, linux-kernel, linux-acpi
Some devices, namely Lenovo Legion devices, have an "extreme" mode where
power draw is at the maximum limit of the cooling hardware. Add a new
"extreme" platform profile to properly reflect this operating mode.
Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.com>
---
Documentation/ABI/testing/sysfs-class-platform-profile | 2 ++
drivers/acpi/platform_profile.c | 1 +
include/linux/platform_profile.h | 1 +
3 files changed, 4 insertions(+)
diff --git a/Documentation/ABI/testing/sysfs-class-platform-profile b/Documentation/ABI/testing/sysfs-class-platform-profile
index dc72adfb830a..9bee8deb4dc9 100644
--- a/Documentation/ABI/testing/sysfs-class-platform-profile
+++ b/Documentation/ABI/testing/sysfs-class-platform-profile
@@ -23,6 +23,8 @@ Description: This file contains a space-separated list of profiles supported
power consumption with a slight bias
towards performance
performance High performance operation
+ extreme Higher performance operation that may exceed
+ internal battery draw limits when on AC power
custom Driver defined custom profile
==================== ========================================
diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c
index b43f4459a4f6..78da17e16d9b 100644
--- a/drivers/acpi/platform_profile.c
+++ b/drivers/acpi/platform_profile.c
@@ -37,6 +37,7 @@ static const char * const profile_names[] = {
[PLATFORM_PROFILE_BALANCED] = "balanced",
[PLATFORM_PROFILE_BALANCED_PERFORMANCE] = "balanced-performance",
[PLATFORM_PROFILE_PERFORMANCE] = "performance",
+ [PLATFORM_PROFILE_EXTREME] = "extreme",
[PLATFORM_PROFILE_CUSTOM] = "custom",
};
static_assert(ARRAY_SIZE(profile_names) == PLATFORM_PROFILE_LAST);
diff --git a/include/linux/platform_profile.h b/include/linux/platform_profile.h
index a299225ab92e..2bf178bde2b5 100644
--- a/include/linux/platform_profile.h
+++ b/include/linux/platform_profile.h
@@ -24,6 +24,7 @@ enum platform_profile_option {
PLATFORM_PROFILE_BALANCED,
PLATFORM_PROFILE_BALANCED_PERFORMANCE,
PLATFORM_PROFILE_PERFORMANCE,
+ PLATFORM_PROFILE_EXTREME,
PLATFORM_PROFILE_CUSTOM,
PLATFORM_PROFILE_LAST, /*must always be last */
};
--
2.51.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/3] platform/x86: lenovo-wmi-gamezone Use Extreme vice balanced-performance
2025-10-26 8:12 [PATCH 0/3] Add extreme platform profile Derek J. Clark
2025-10-26 8:12 ` [PATCH 1/3] acpi: platform_profile - Add Extreme profile option Derek J. Clark
@ 2025-10-26 8:12 ` Derek J. Clark
2025-10-26 17:52 ` Mario Limonciello
2025-10-26 8:12 ` [PATCH 3/3] platform/x86: lenovo-wmi-gamezone Use explicit allow list Derek J. Clark
2 siblings, 1 reply; 12+ messages in thread
From: Derek J. Clark @ 2025-10-26 8:12 UTC (permalink / raw)
To: Hans de Goede, Ilpo Järvinen, Armin Wolf, Len Brown,
Rafael J . Wysocki, Jonathan Corbet
Cc: Mario Limonciello, Zhixin Zhang, Mia Shao, Mark Pearson,
Pierre-Loup A . Griffais, Kurt Borja, Derek J . Clark,
platform-driver-x86, linux-doc, linux-kernel, linux-acpi
When upstreaming the gamezone WMI drivers the "extreme" mode was matched
to performance and performance was matched to balanced-performance, but
only when extreme mode was fully enabled. Otherwise performance was
matched to performance. This has led to quite a bit of confusion with
users not understanding why the LED color indicating the platform
profile doesn't match their expectations. To solve this, replace the
confusing convention with the new "extreme" profile.
Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.com>
---
.../wmi/devices/lenovo-wmi-gamezone.rst | 10 +++-------
drivers/platform/x86/lenovo/wmi-gamezone.c | 18 +++++-------------
2 files changed, 8 insertions(+), 20 deletions(-)
diff --git a/Documentation/wmi/devices/lenovo-wmi-gamezone.rst b/Documentation/wmi/devices/lenovo-wmi-gamezone.rst
index 997263e51a7d..6c908f44a08e 100644
--- a/Documentation/wmi/devices/lenovo-wmi-gamezone.rst
+++ b/Documentation/wmi/devices/lenovo-wmi-gamezone.rst
@@ -24,18 +24,14 @@ current platform profile when it changes.
The following platform profiles are supported:
- low-power
- balanced
- - balanced-performance
- performance
+ - extreme
- custom
-Balanced-Performance
+Extreme
~~~~~~~~~~~~~~~~~~~~
Some newer Lenovo "Gaming Series" laptops have an "Extreme Mode" profile
-enabled in their BIOS. For these devices, the performance platform profile
-corresponds to the BIOS Extreme Mode, while the balanced-performance
-platform profile corresponds to the BIOS Performance mode. For legacy
-devices, the performance platform profile will correspond with the BIOS
-Performance mode.
+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
diff --git a/drivers/platform/x86/lenovo/wmi-gamezone.c b/drivers/platform/x86/lenovo/wmi-gamezone.c
index 0eb7fe8222f4..faabbd4657bd 100644
--- a/drivers/platform/x86/lenovo/wmi-gamezone.c
+++ b/drivers/platform/x86/lenovo/wmi-gamezone.c
@@ -171,14 +171,10 @@ static int lwmi_gz_profile_get(struct device *dev,
*profile = PLATFORM_PROFILE_BALANCED;
break;
case LWMI_GZ_THERMAL_MODE_PERFORMANCE:
- if (priv->extreme_supported) {
- *profile = PLATFORM_PROFILE_BALANCED_PERFORMANCE;
- break;
- }
*profile = PLATFORM_PROFILE_PERFORMANCE;
break;
case LWMI_GZ_THERMAL_MODE_EXTREME:
- *profile = PLATFORM_PROFILE_PERFORMANCE;
+ *profile = PLATFORM_PROFILE_EXTREME;
break;
case LWMI_GZ_THERMAL_MODE_CUSTOM:
*profile = PLATFORM_PROFILE_CUSTOM;
@@ -218,16 +214,12 @@ static int lwmi_gz_profile_set(struct device *dev,
case PLATFORM_PROFILE_BALANCED:
mode = LWMI_GZ_THERMAL_MODE_BALANCED;
break;
- case PLATFORM_PROFILE_BALANCED_PERFORMANCE:
- mode = LWMI_GZ_THERMAL_MODE_PERFORMANCE;
- break;
case PLATFORM_PROFILE_PERFORMANCE:
- if (priv->extreme_supported) {
- mode = LWMI_GZ_THERMAL_MODE_EXTREME;
- break;
- }
mode = LWMI_GZ_THERMAL_MODE_PERFORMANCE;
break;
+ case PLATFORM_PROFILE_EXTREME:
+ mode = LWMI_GZ_THERMAL_MODE_EXTREME;
+ break;
case PLATFORM_PROFILE_CUSTOM:
mode = LWMI_GZ_THERMAL_MODE_CUSTOM;
break;
@@ -338,7 +330,7 @@ static int lwmi_gz_platform_profile_probe(void *drvdata, unsigned long *choices)
priv->extreme_supported = lwmi_gz_extreme_supported(profile_support_ver);
if (priv->extreme_supported)
- set_bit(PLATFORM_PROFILE_BALANCED_PERFORMANCE, choices);
+ set_bit(PLATFORM_PROFILE_EXTREME, choices);
return 0;
}
--
2.51.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/3] platform/x86: lenovo-wmi-gamezone Use explicit allow list
2025-10-26 8:12 [PATCH 0/3] Add extreme platform profile Derek J. Clark
2025-10-26 8:12 ` [PATCH 1/3] acpi: platform_profile - Add Extreme profile option Derek J. Clark
2025-10-26 8:12 ` [PATCH 2/3] platform/x86: lenovo-wmi-gamezone Use Extreme vice balanced-performance Derek J. Clark
@ 2025-10-26 8:12 ` Derek J. Clark
2025-10-26 17:50 ` Mario Limonciello
2 siblings, 1 reply; 12+ messages in thread
From: Derek J. Clark @ 2025-10-26 8:12 UTC (permalink / raw)
To: Hans de Goede, Ilpo Järvinen, Armin Wolf, Len Brown,
Rafael J . Wysocki, Jonathan Corbet
Cc: Mario Limonciello, Zhixin Zhang, Mia Shao, Mark Pearson,
Pierre-Loup A . Griffais, Kurt Borja, Derek J . Clark,
platform-driver-x86, linux-doc, linux-kernel, linux-acpi
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.
Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.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;
--
2.51.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] platform/x86: lenovo-wmi-gamezone Use explicit allow list
2025-10-26 8:12 ` [PATCH 3/3] platform/x86: lenovo-wmi-gamezone Use explicit allow list Derek J. Clark
@ 2025-10-26 17:50 ` Mario Limonciello
2025-10-26 19:22 ` Derek J. Clark
0 siblings, 1 reply; 12+ messages in thread
From: Mario Limonciello @ 2025-10-26 17:50 UTC (permalink / raw)
To: Derek J. Clark, Hans de Goede, Ilpo Järvinen, Armin Wolf,
Len Brown, Rafael J . Wysocki, Jonathan Corbet
Cc: Zhixin Zhang, Mia Shao, Mark Pearson, Pierre-Loup A . Griffais,
Kurt Borja, platform-driver-x86, linux-doc, linux-kernel,
linux-acpi
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.
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?
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.
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.
>
> Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.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;
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/3] platform/x86: lenovo-wmi-gamezone Use Extreme vice balanced-performance
2025-10-26 8:12 ` [PATCH 2/3] platform/x86: lenovo-wmi-gamezone Use Extreme vice balanced-performance Derek J. Clark
@ 2025-10-26 17:52 ` Mario Limonciello
2025-10-26 19:10 ` Derek J. Clark
0 siblings, 1 reply; 12+ messages in thread
From: Mario Limonciello @ 2025-10-26 17:52 UTC (permalink / raw)
To: Derek J. Clark, Hans de Goede, Ilpo Järvinen, Armin Wolf,
Len Brown, Rafael J . Wysocki, Jonathan Corbet
Cc: Zhixin Zhang, Mia Shao, Mark Pearson, Pierre-Loup A . Griffais,
Kurt Borja, platform-driver-x86, linux-doc, linux-kernel,
linux-acpi
Is 'vice' the right word for the subject?
On 10/26/25 3:12 AM, Derek J. Clark wrote:
> When upstreaming the gamezone WMI drivers the "extreme" mode was matched
> to performance and performance was matched to balanced-performance, but
> only when extreme mode was fully enabled. Otherwise performance was
> matched to performance. This has led to quite a bit of confusion with
> users not understanding why the LED color indicating the platform
> profile doesn't match their expectations. To solve this, replace the
> confusing convention with the new "extreme" profile.
Are the colors common to all devices? Maybe it would be worth adding to
the documentation the expected colors for each mode.
>
> Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.com>
> ---
> .../wmi/devices/lenovo-wmi-gamezone.rst | 10 +++-------
> drivers/platform/x86/lenovo/wmi-gamezone.c | 18 +++++-------------
> 2 files changed, 8 insertions(+), 20 deletions(-)
>
> diff --git a/Documentation/wmi/devices/lenovo-wmi-gamezone.rst b/Documentation/wmi/devices/lenovo-wmi-gamezone.rst
> index 997263e51a7d..6c908f44a08e 100644
> --- a/Documentation/wmi/devices/lenovo-wmi-gamezone.rst
> +++ b/Documentation/wmi/devices/lenovo-wmi-gamezone.rst
> @@ -24,18 +24,14 @@ current platform profile when it changes.
> The following platform profiles are supported:
> - low-power
> - balanced
> - - balanced-performance
> - performance
> + - extreme
> - custom
>
> -Balanced-Performance
> +Extreme
> ~~~~~~~~~~~~~~~~~~~~
> Some newer Lenovo "Gaming Series" laptops have an "Extreme Mode" profile
> -enabled in their BIOS. For these devices, the performance platform profile
> -corresponds to the BIOS Extreme Mode, while the balanced-performance
> -platform profile corresponds to the BIOS Performance mode. For legacy
> -devices, the performance platform profile will correspond with the BIOS
> -Performance mode.
> +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
> diff --git a/drivers/platform/x86/lenovo/wmi-gamezone.c b/drivers/platform/x86/lenovo/wmi-gamezone.c
> index 0eb7fe8222f4..faabbd4657bd 100644
> --- a/drivers/platform/x86/lenovo/wmi-gamezone.c
> +++ b/drivers/platform/x86/lenovo/wmi-gamezone.c
> @@ -171,14 +171,10 @@ static int lwmi_gz_profile_get(struct device *dev,
> *profile = PLATFORM_PROFILE_BALANCED;
> break;
> case LWMI_GZ_THERMAL_MODE_PERFORMANCE:
> - if (priv->extreme_supported) {
> - *profile = PLATFORM_PROFILE_BALANCED_PERFORMANCE;
> - break;
> - }
> *profile = PLATFORM_PROFILE_PERFORMANCE;
> break;
> case LWMI_GZ_THERMAL_MODE_EXTREME:
> - *profile = PLATFORM_PROFILE_PERFORMANCE;
> + *profile = PLATFORM_PROFILE_EXTREME;
> break;
> case LWMI_GZ_THERMAL_MODE_CUSTOM:
> *profile = PLATFORM_PROFILE_CUSTOM;
> @@ -218,16 +214,12 @@ static int lwmi_gz_profile_set(struct device *dev,
> case PLATFORM_PROFILE_BALANCED:
> mode = LWMI_GZ_THERMAL_MODE_BALANCED;
> break;
> - case PLATFORM_PROFILE_BALANCED_PERFORMANCE:
> - mode = LWMI_GZ_THERMAL_MODE_PERFORMANCE;
> - break;
> case PLATFORM_PROFILE_PERFORMANCE:
> - if (priv->extreme_supported) {
> - mode = LWMI_GZ_THERMAL_MODE_EXTREME;
> - break;
> - }
> mode = LWMI_GZ_THERMAL_MODE_PERFORMANCE;
> break;
> + case PLATFORM_PROFILE_EXTREME:
> + mode = LWMI_GZ_THERMAL_MODE_EXTREME;
> + break;
> case PLATFORM_PROFILE_CUSTOM:
> mode = LWMI_GZ_THERMAL_MODE_CUSTOM;
> break;
> @@ -338,7 +330,7 @@ static int lwmi_gz_platform_profile_probe(void *drvdata, unsigned long *choices)
>
> priv->extreme_supported = lwmi_gz_extreme_supported(profile_support_ver);
> if (priv->extreme_supported)
> - set_bit(PLATFORM_PROFILE_BALANCED_PERFORMANCE, choices);
> + set_bit(PLATFORM_PROFILE_EXTREME, choices);
>
> return 0;
> }
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] acpi: platform_profile - Add Extreme profile option
2025-10-26 8:12 ` [PATCH 1/3] acpi: platform_profile - Add Extreme profile option Derek J. Clark
@ 2025-10-26 17:53 ` Mario Limonciello
2025-11-03 15:58 ` Rafael J. Wysocki
1 sibling, 0 replies; 12+ messages in thread
From: Mario Limonciello @ 2025-10-26 17:53 UTC (permalink / raw)
To: Derek J. Clark, Hans de Goede, Ilpo Järvinen, Armin Wolf,
Len Brown, Rafael J . Wysocki, Jonathan Corbet
Cc: Zhixin Zhang, Mia Shao, Mark Pearson, Pierre-Loup A . Griffais,
Kurt Borja, platform-driver-x86, linux-doc, linux-kernel,
linux-acpi
On 10/26/25 3:12 AM, Derek J. Clark wrote:
> Some devices, namely Lenovo Legion devices, have an "extreme" mode where
> power draw is at the maximum limit of the cooling hardware. Add a new
> "extreme" platform profile to properly reflect this operating mode.
>
> Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
> ---
> Documentation/ABI/testing/sysfs-class-platform-profile | 2 ++
> drivers/acpi/platform_profile.c | 1 +
> include/linux/platform_profile.h | 1 +
> 3 files changed, 4 insertions(+)
>
> diff --git a/Documentation/ABI/testing/sysfs-class-platform-profile b/Documentation/ABI/testing/sysfs-class-platform-profile
> index dc72adfb830a..9bee8deb4dc9 100644
> --- a/Documentation/ABI/testing/sysfs-class-platform-profile
> +++ b/Documentation/ABI/testing/sysfs-class-platform-profile
> @@ -23,6 +23,8 @@ Description: This file contains a space-separated list of profiles supported
> power consumption with a slight bias
> towards performance
> performance High performance operation
> + extreme Higher performance operation that may exceed
> + internal battery draw limits when on AC power
> custom Driver defined custom profile
> ==================== ========================================
>
> diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c
> index b43f4459a4f6..78da17e16d9b 100644
> --- a/drivers/acpi/platform_profile.c
> +++ b/drivers/acpi/platform_profile.c
> @@ -37,6 +37,7 @@ static const char * const profile_names[] = {
> [PLATFORM_PROFILE_BALANCED] = "balanced",
> [PLATFORM_PROFILE_BALANCED_PERFORMANCE] = "balanced-performance",
> [PLATFORM_PROFILE_PERFORMANCE] = "performance",
> + [PLATFORM_PROFILE_EXTREME] = "extreme",
> [PLATFORM_PROFILE_CUSTOM] = "custom",
> };
> static_assert(ARRAY_SIZE(profile_names) == PLATFORM_PROFILE_LAST);
> diff --git a/include/linux/platform_profile.h b/include/linux/platform_profile.h
> index a299225ab92e..2bf178bde2b5 100644
> --- a/include/linux/platform_profile.h
> +++ b/include/linux/platform_profile.h
> @@ -24,6 +24,7 @@ enum platform_profile_option {
> PLATFORM_PROFILE_BALANCED,
> PLATFORM_PROFILE_BALANCED_PERFORMANCE,
> PLATFORM_PROFILE_PERFORMANCE,
> + PLATFORM_PROFILE_EXTREME,
> PLATFORM_PROFILE_CUSTOM,
> PLATFORM_PROFILE_LAST, /*must always be last */
> };
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/3] platform/x86: lenovo-wmi-gamezone Use Extreme vice balanced-performance
2025-10-26 17:52 ` Mario Limonciello
@ 2025-10-26 19:10 ` Derek J. Clark
0 siblings, 0 replies; 12+ messages in thread
From: Derek J. Clark @ 2025-10-26 19:10 UTC (permalink / raw)
To: Mario Limonciello, Hans de Goede, Ilpo Järvinen, Armin Wolf,
Len Brown, Rafael J . Wysocki, Jonathan Corbet
Cc: Zhixin Zhang, Mia Shao, Mark Pearson, Pierre-Loup A . Griffais,
Kurt Borja, platform-driver-x86, linux-doc, linux-kernel,
linux-acpi
On October 26, 2025 10:52:29 AM PDT, Mario Limonciello <superm1@kernel.org> wrote:
>Is 'vice' the right word for the subject?
>
Used as in rather than or as an alternative to, it has more brevity.
>On 10/26/25 3:12 AM, Derek J. Clark wrote:
>> When upstreaming the gamezone WMI drivers the "extreme" mode was matched
>> to performance and performance was matched to balanced-performance, but
>> only when extreme mode was fully enabled. Otherwise performance was
>> matched to performance. This has led to quite a bit of confusion with
>> users not understanding why the LED color indicating the platform
>> profile doesn't match their expectations. To solve this, replace the
>> confusing convention with the new "extreme" profile.
>
>Are the colors common to all devices? Maybe it would be worth adding to the documentation the expected colors for each mode.
>
I think so, based on every case I've run into. I'll need to expound a little and reword more in this section but that should be doable.
Thanks,
Derek
>>
>> Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.com>
>> ---
>> .../wmi/devices/lenovo-wmi-gamezone.rst | 10 +++-------
>> drivers/platform/x86/lenovo/wmi-gamezone.c | 18 +++++-------------
>> 2 files changed, 8 insertions(+), 20 deletions(-)
>>
>> diff --git a/Documentation/wmi/devices/lenovo-wmi-gamezone.rst b/Documentation/wmi/devices/lenovo-wmi-gamezone.rst
>> index 997263e51a7d..6c908f44a08e 100644
>> --- a/Documentation/wmi/devices/lenovo-wmi-gamezone.rst
>> +++ b/Documentation/wmi/devices/lenovo-wmi-gamezone.rst
>> @@ -24,18 +24,14 @@ current platform profile when it changes.
>> The following platform profiles are supported:
>> - low-power
>> - balanced
>> - - balanced-performance
>> - performance
>> + - extreme
>> - custom
>> -Balanced-Performance
>> +Extreme
>> ~~~~~~~~~~~~~~~~~~~~
>> Some newer Lenovo "Gaming Series" laptops have an "Extreme Mode" profile
>> -enabled in their BIOS. For these devices, the performance platform profile
>> -corresponds to the BIOS Extreme Mode, while the balanced-performance
>> -platform profile corresponds to the BIOS Performance mode. For legacy
>> -devices, the performance platform profile will correspond with the BIOS
>> -Performance mode.
>> +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
>> diff --git a/drivers/platform/x86/lenovo/wmi-gamezone.c b/drivers/platform/x86/lenovo/wmi-gamezone.c
>> index 0eb7fe8222f4..faabbd4657bd 100644
>> --- a/drivers/platform/x86/lenovo/wmi-gamezone.c
>> +++ b/drivers/platform/x86/lenovo/wmi-gamezone.c
>> @@ -171,14 +171,10 @@ static int lwmi_gz_profile_get(struct device *dev,
>> *profile = PLATFORM_PROFILE_BALANCED;
>> break;
>> case LWMI_GZ_THERMAL_MODE_PERFORMANCE:
>> - if (priv->extreme_supported) {
>> - *profile = PLATFORM_PROFILE_BALANCED_PERFORMANCE;
>> - break;
>> - }
>> *profile = PLATFORM_PROFILE_PERFORMANCE;
>> break;
>> case LWMI_GZ_THERMAL_MODE_EXTREME:
>> - *profile = PLATFORM_PROFILE_PERFORMANCE;
>> + *profile = PLATFORM_PROFILE_EXTREME;
>> break;
>> case LWMI_GZ_THERMAL_MODE_CUSTOM:
>> *profile = PLATFORM_PROFILE_CUSTOM;
>> @@ -218,16 +214,12 @@ static int lwmi_gz_profile_set(struct device *dev,
>> case PLATFORM_PROFILE_BALANCED:
>> mode = LWMI_GZ_THERMAL_MODE_BALANCED;
>> break;
>> - case PLATFORM_PROFILE_BALANCED_PERFORMANCE:
>> - mode = LWMI_GZ_THERMAL_MODE_PERFORMANCE;
>> - break;
>> case PLATFORM_PROFILE_PERFORMANCE:
>> - if (priv->extreme_supported) {
>> - mode = LWMI_GZ_THERMAL_MODE_EXTREME;
>> - break;
>> - }
>> mode = LWMI_GZ_THERMAL_MODE_PERFORMANCE;
>> break;
>> + case PLATFORM_PROFILE_EXTREME:
>> + mode = LWMI_GZ_THERMAL_MODE_EXTREME;
>> + break;
>> case PLATFORM_PROFILE_CUSTOM:
>> mode = LWMI_GZ_THERMAL_MODE_CUSTOM;
>> break;
>> @@ -338,7 +330,7 @@ static int lwmi_gz_platform_profile_probe(void *drvdata, unsigned long *choices)
>> priv->extreme_supported = lwmi_gz_extreme_supported(profile_support_ver);
>> if (priv->extreme_supported)
>> - set_bit(PLATFORM_PROFILE_BALANCED_PERFORMANCE, choices);
>> + set_bit(PLATFORM_PROFILE_EXTREME, choices);
>> return 0;
>> }
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] platform/x86: lenovo-wmi-gamezone Use explicit allow list
2025-10-26 17:50 ` Mario Limonciello
@ 2025-10-26 19:22 ` Derek J. Clark
2025-10-26 21:19 ` Mario Limonciello
0 siblings, 1 reply; 12+ messages in thread
From: Derek J. Clark @ 2025-10-26 19:22 UTC (permalink / raw)
To: Mario Limonciello, Hans de Goede, Ilpo Järvinen, Armin Wolf,
Len Brown, Rafael J . Wysocki, Jonathan Corbet
Cc: Zhixin Zhang, Mia Shao, Mark Pearson, Pierre-Loup A . Griffais,
Kurt Borja, platform-driver-x86, linux-doc, linux-kernel,
linux-acpi
On October 26, 2025 10:50:40 AM PDT, Mario Limonciello <superm1@kernel.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.
>
>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?
>
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.
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.
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.
>
>>
>> Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.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;
>>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] platform/x86: lenovo-wmi-gamezone Use explicit allow list
2025-10-26 19:22 ` Derek J. Clark
@ 2025-10-26 21:19 ` Mario Limonciello
2025-10-31 1:19 ` Derek John Clark
0 siblings, 1 reply; 12+ messages in thread
From: Mario Limonciello @ 2025-10-26 21:19 UTC (permalink / raw)
To: Derek J. Clark, Hans de Goede, Ilpo Järvinen, Armin Wolf,
Len Brown, Rafael J . Wysocki, Jonathan Corbet
Cc: Zhixin Zhang, Mia Shao, Mark Pearson, Pierre-Loup A . Griffais,
Kurt Borja, platform-driver-x86, linux-doc, linux-kernel,
linux-acpi
On 10/26/25 2:22 PM, Derek J. Clark wrote:
> On October 26, 2025 10:50:40 AM PDT, Mario Limonciello <superm1@kernel.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.
>>
>> 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?
>>
> 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.
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.
>
> 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.
>>
>>>
>>> Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.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;
>>>
>>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] platform/x86: lenovo-wmi-gamezone Use explicit allow list
2025-10-26 21:19 ` Mario Limonciello
@ 2025-10-31 1:19 ` Derek John Clark
0 siblings, 0 replies; 12+ messages in thread
From: Derek John Clark @ 2025-10-31 1:19 UTC (permalink / raw)
To: Mario Limonciello
Cc: Hans de Goede, Ilpo Järvinen, Armin Wolf, Len Brown,
Rafael J . Wysocki, Jonathan Corbet, Zhixin Zhang, Mia Shao,
Mark Pearson, Pierre-Loup A . Griffais, Kurt Borja,
platform-driver-x86, linux-doc, linux-kernel, linux-acpi
On Sun, Oct 26, 2025 at 2:19 PM Mario Limonciello <superm1@kernel.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@kernel.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@gmail.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;
> >>>
> >>
> >
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] acpi: platform_profile - Add Extreme profile option
2025-10-26 8:12 ` [PATCH 1/3] acpi: platform_profile - Add Extreme profile option Derek J. Clark
2025-10-26 17:53 ` Mario Limonciello
@ 2025-11-03 15:58 ` Rafael J. Wysocki
1 sibling, 0 replies; 12+ messages in thread
From: Rafael J. Wysocki @ 2025-11-03 15:58 UTC (permalink / raw)
To: Derek J. Clark
Cc: Hans de Goede, Ilpo Järvinen, Armin Wolf, Len Brown,
Rafael J . Wysocki, Jonathan Corbet, Mario Limonciello,
Zhixin Zhang, Mia Shao, Mark Pearson, Pierre-Loup A . Griffais,
Kurt Borja, platform-driver-x86, linux-doc, linux-kernel,
linux-acpi
On Sun, Oct 26, 2025 at 9:12 AM Derek J. Clark
<derekjohn.clark@gmail.com> wrote:
>
> Some devices, namely Lenovo Legion devices, have an "extreme" mode where
> power draw is at the maximum limit of the cooling hardware. Add a new
> "extreme" platform profile to properly reflect this operating mode.
>
> Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.com>
This is fine with me from the ACPI angle, so
Acked-by: Rafael J. Wysocki (Intel) <rafael@kernel.org>
> ---
> Documentation/ABI/testing/sysfs-class-platform-profile | 2 ++
> drivers/acpi/platform_profile.c | 1 +
> include/linux/platform_profile.h | 1 +
> 3 files changed, 4 insertions(+)
>
> diff --git a/Documentation/ABI/testing/sysfs-class-platform-profile b/Documentation/ABI/testing/sysfs-class-platform-profile
> index dc72adfb830a..9bee8deb4dc9 100644
> --- a/Documentation/ABI/testing/sysfs-class-platform-profile
> +++ b/Documentation/ABI/testing/sysfs-class-platform-profile
> @@ -23,6 +23,8 @@ Description: This file contains a space-separated list of profiles supported
> power consumption with a slight bias
> towards performance
> performance High performance operation
> + extreme Higher performance operation that may exceed
> + internal battery draw limits when on AC power
> custom Driver defined custom profile
> ==================== ========================================
>
> diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c
> index b43f4459a4f6..78da17e16d9b 100644
> --- a/drivers/acpi/platform_profile.c
> +++ b/drivers/acpi/platform_profile.c
> @@ -37,6 +37,7 @@ static const char * const profile_names[] = {
> [PLATFORM_PROFILE_BALANCED] = "balanced",
> [PLATFORM_PROFILE_BALANCED_PERFORMANCE] = "balanced-performance",
> [PLATFORM_PROFILE_PERFORMANCE] = "performance",
> + [PLATFORM_PROFILE_EXTREME] = "extreme",
> [PLATFORM_PROFILE_CUSTOM] = "custom",
> };
> static_assert(ARRAY_SIZE(profile_names) == PLATFORM_PROFILE_LAST);
> diff --git a/include/linux/platform_profile.h b/include/linux/platform_profile.h
> index a299225ab92e..2bf178bde2b5 100644
> --- a/include/linux/platform_profile.h
> +++ b/include/linux/platform_profile.h
> @@ -24,6 +24,7 @@ enum platform_profile_option {
> PLATFORM_PROFILE_BALANCED,
> PLATFORM_PROFILE_BALANCED_PERFORMANCE,
> PLATFORM_PROFILE_PERFORMANCE,
> + PLATFORM_PROFILE_EXTREME,
> PLATFORM_PROFILE_CUSTOM,
> PLATFORM_PROFILE_LAST, /*must always be last */
> };
> --
> 2.51.1
>
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2025-11-03 15:58 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-26 8:12 [PATCH 0/3] Add extreme platform profile Derek J. Clark
2025-10-26 8:12 ` [PATCH 1/3] acpi: platform_profile - Add Extreme profile option Derek J. Clark
2025-10-26 17:53 ` Mario Limonciello
2025-11-03 15:58 ` Rafael J. Wysocki
2025-10-26 8:12 ` [PATCH 2/3] platform/x86: lenovo-wmi-gamezone Use Extreme vice balanced-performance Derek J. Clark
2025-10-26 17:52 ` Mario Limonciello
2025-10-26 19:10 ` Derek J. Clark
2025-10-26 8:12 ` [PATCH 3/3] platform/x86: lenovo-wmi-gamezone Use explicit allow list Derek J. Clark
2025-10-26 17:50 ` Mario Limonciello
2025-10-26 19:22 ` Derek J. Clark
2025-10-26 21:19 ` Mario Limonciello
2025-10-31 1:19 ` Derek John Clark
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).