Add extreme platform profile
Subsystems (5)
Derek J. Clark
maintainercover Add extreme platform profile
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.
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(-)
Signature · 1 line
2.51.1
Derek J. Clark
maintainerPATCH 1/3 acpi: platform_profile - Add Extreme profile option
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.
--- 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(+)
Documentation/ABI/testing/sysfs-class-platform-profile +2 -0
@@ -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 ==================== ========================================
drivers/acpi/platform_profile.c +1 -0
@@ -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 );
include/linux/platform_profile.h +1 -0
@@ -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 */ };
Signature · 1 line
2.51.1
Re: [PATCH 1/3] acpi: platform_profile - Add Extreme profile option
Quoted 5 lines · Derek J. Clark
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 <[email protected]>
Quoted 43 lines
--- 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(+)Documentation/ABI/testing/sysfs-class-platform-profile +2
-0@@ -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 ==================== ========================================drivers/acpi/platform_profile.c +1
-0@@ -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 );include/linux/platform_profile.h +1
-0@@ -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 */ };
Re: [PATCH 1/3] acpi: platform_profile - Add Extreme profile option
In reply to Derek J. ClarkQuoted 6 lines · Derek J. Clark
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 <[email protected]>
This is fine with me from the ACPI angle, so
Quoted 46 lines
--- 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(+)Documentation/ABI/testing/sysfs-class-platform-profile +2
-0@@ -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 ==================== ========================================drivers/acpi/platform_profile.c +1
-0@@ -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 );include/linux/platform_profile.h +1
-1@@ -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
Derek J. Clark
maintainerPATCH 2/3 platform/x86: lenovo-wmi-gamezone Use Extreme vice balanced-performance
In reply to Derek J. ClarkWhen 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.
--- .../wmi/devices/lenovo-wmi-gamezone.rst | 10 +++------- drivers/platform/x86/lenovo/wmi-gamezone.c | 18 +++++------------- 2 files changed, 8 insertions(+), 20 deletions(-)
Documentation/wmi/devices/lenovo-wmi-gamezone.rst +3 -7
@@ -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
drivers/platform/x86/lenovo/wmi-gamezone.c +5 -13
@@ -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 ; }
Signature · 1 line
2.51.1
Re: [PATCH 2/3] platform/x86: lenovo-wmi-gamezone Use Extreme vice balanced-performance
Is 'vice' the right word for the subject?
Quoted 7 lines · Derek J. Clark
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.
Quoted 82 lines
Signed-off-by Derek J. Clark <[email protected]>--- .../wmi/devices/lenovo-wmi-gamezone.rst | 10 +++------- drivers/platform/x86/lenovo/wmi-gamezone.c | 18 +++++------------- 2 files changed, 8 insertions(+), 20 deletions(-)Documentation/wmi/devices/lenovo-wmi-gamezone.rst +3
-7@@ -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 isdrivers/platform/x86/lenovo/wmi-gamezone.c +5
-13@@ -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 ; }
Derek J. Clark
maintainerRe: [PATCH 2/3] platform/x86: lenovo-wmi-gamezone Use Extreme vice balanced-performance
Quoted 2 lines · Mario Limonciello
Is 'vice' the right word for the subject?
Used as in rather than or as an alternative to, it has more brevity.
Quoted 11 lines · Derek J. Clark
Quoted 7 lines
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
Quoted 79 lines
Quoted 78 lines
Signed-off-by Derek J. Clark <[email protected]>--- .../wmi/devices/lenovo-wmi-gamezone.rst | 10 +++------- drivers/platform/x86/lenovo/wmi-gamezone.c | 18 +++++------------- 2 files changed, 8 insertions(+), 20 deletions(-)Documentation/wmi/devices/lenovo-wmi-gamezone.rst +3
-6@@ -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 isdrivers/platform/x86/lenovo/wmi-gamezone.c +5
-13@@ -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 ; }
Derek J. Clark
maintainerPATCH 3/3 platform/x86: lenovo-wmi-gamezone Use explicit allow list
In reply to Derek J. ClarkThe 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.
--- .../wmi/devices/lenovo-wmi-gamezone.rst | 10 +++--- drivers/platform/x86/lenovo/wmi-gamezone.c | 33 ++----------------- 2 files changed, 8 insertions(+), 35 deletions(-)
Documentation/wmi/devices/lenovo-wmi-gamezone.rst +5 -5
@@ -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 ~~~~~~~~~~~~~~
drivers/platform/x86/lenovo/wmi-gamezone.c +3 -30
@@ -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;
Signature · 1 line
2.51.1
Re: [PATCH 3/3] platform/x86: lenovo-wmi-gamezone Use explicit allow list
Quoted 7 lines · Derek J. Clark
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.
Quoted 94 lines
Signed-off-by Derek J. Clark <[email protected]>--- .../wmi/devices/lenovo-wmi-gamezone.rst | 10 +++--- drivers/platform/x86/lenovo/wmi-gamezone.c | 33 ++----------------- 2 files changed, 8 insertions(+), 35 deletions(-)Documentation/wmi/devices/lenovo-wmi-gamezone.rst +5
-5@@ -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 ~~~~~~~~~~~~~~drivers/platform/x86/lenovo/wmi-gamezone.c +3
-30@@ -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;
Derek J. Clark
maintainerRe: [PATCH 3/3] platform/x86: lenovo-wmi-gamezone Use explicit allow list
Quoted 11 lines · Mario Limonciello
Quoted 7 lines · Derek J. Clark
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.
Quoted 2 lines
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.
Quoted 1 line
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
Quoted 91 lines
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.
Quoted 88 lines
Signed-off-by Derek J. Clark <[email protected]>--- .../wmi/devices/lenovo-wmi-gamezone.rst | 10 +++--- drivers/platform/x86/lenovo/wmi-gamezone.c | 33 ++----------------- 2 files changed, 8 insertions(+), 35 deletions(-)Documentation/wmi/devices/lenovo-wmi-gamezone.rst +5
-5@@ -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 ~~~~~~~~~~~~~~drivers/platform/x86/lenovo/wmi-gamezone.c +2
-29@@ -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;
Re: [PATCH 3/3] platform/x86: lenovo-wmi-gamezone Use explicit allow list
Quoted 12 lines · Derek J. Clark
Quoted 11 lines · Mario Limonciello
Quoted 7 lines · Derek J. Clark
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.
Quoted 3 lines
Quoted 2 lines
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.
Quoted 6 lines
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.
Quoted 1 line
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.
Quoted 96 lines
Thanks,
DerekQuoted 91 lines
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.
Quoted 88 lines
Signed-off-by Derek J. Clark <[email protected]>--- .../wmi/devices/lenovo-wmi-gamezone.rst | 10 +++--- drivers/platform/x86/lenovo/wmi-gamezone.c | 33 ++----------------- 2 files changed, 8 insertions(+), 35 deletions(-)Documentation/wmi/devices/lenovo-wmi-gamezone.rst +5
-5@@ -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 ~~~~~~~~~~~~~~drivers/platform/x86/lenovo/wmi-gamezone.c +2
-29@@ -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;
Derek John Clark
maintainerRe: [PATCH 3/3] platform/x86: lenovo-wmi-gamezone Use explicit allow list
Quoted 8 lines · Mario Limonciello
Quoted 4 lines · Derek J. Clark
Quoted 3 lines · Mario Limonciello
On 10/26/25 3:12 AM, Derek J. Clark wrote:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
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.
Quoted 1 line
Quoted 1 line
Quoted 1 line
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.
Quoted 1 line
Quoted 1 line
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.
Quoted 5 lines
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.
Quoted 14 lines
Quoted 6 lines
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.
Quoted 1 line
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.
Quoted 5 lines
Thanks,
DerekQuoted 1 line
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
Quoted 92 lines
Quoted 91 lines
Quoted 90 lines
Quoted 89 lines
Signed-off-by Derek J. Clark <[email protected]>--- .../wmi/devices/lenovo-wmi-gamezone.rst | 10 +++--- drivers/platform/x86/lenovo/wmi-gamezone.c | 33 ++----------------- 2 files changed, 8 insertions(+), 35 deletions(-)Documentation/wmi/devices/lenovo-wmi-gamezone.rst +5
-5@@ -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 ~~~~~~~~~~~~~~drivers/platform/x86/lenovo/wmi-gamezone.c +2
-29@@ -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;