[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <317ca1e0-5217-4ed4-8d66-b35fae6b6a67@gmx.de>
Date: Thu, 27 Nov 2025 23:10:35 +0100
From: Armin Wolf <W_Armin@....de>
To: "Derek J. Clark" <derekjohn.clark@...il.com>,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
Len Brown <lenb@...nel.org>, "Rafael J . Wysocki" <rafael@...nel.org>,
Jonathan Corbet <corbet@....net>
Cc: Mario Limonciello <superm1@...nel.org>,
Zhixin Zhang <zhangzx36@...ovo.com>, Mia Shao <shaohz1@...ovo.com>,
Mark Pearson <mpearson-lenovo@...ebb.ca>,
"Pierre-Loup A . Griffais" <pgriffais@...vesoftware.com>,
Kurt Borja <kuurtb@...il.com>, platform-driver-x86@...r.kernel.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-acpi@...r.kernel.org
Subject: Re: [PATCH v4 1/3] acpi: platform_profile - Add max-power profile
option
Am 27.11.25 um 16:16 schrieb 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
> "max-power" platform profile to properly reflect this operating mode.
Reviewed-by: Armin Wolf <W_Armin@....de>
> Reviewed-by: Mario Limonciello (AMD) <superm1@...nel.org>
> Acked-by: Rafael J. Wysocki (Intel) <rafael@...nel.org>
> Signed-off-by: Derek J. Clark <derekjohn.clark@...il.com>
> ---
> Documentation/ABI/testing/sysfs-class-platform-profile | 2 ++
> drivers/acpi/platform_profile.c | 7 +++++--
> include/linux/platform_profile.h | 1 +
> 3 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/ABI/testing/sysfs-class-platform-profile b/Documentation/ABI/testing/sysfs-class-platform-profile
> index dc72adfb830a..fcab26894ec3 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
> + max-power 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..ea04a8c69215 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_MAX_POWER] = "max-power",
> [PLATFORM_PROFILE_CUSTOM] = "custom",
> };
> static_assert(ARRAY_SIZE(profile_names) == PLATFORM_PROFILE_LAST);
> @@ -506,7 +507,8 @@ int platform_profile_cycle(void)
> if (err)
> return err;
>
> - if (profile == PLATFORM_PROFILE_CUSTOM ||
> + if (profile == PLATFORM_PROFILE_MAX_POWER ||
> + profile == PLATFORM_PROFILE_CUSTOM ||
> profile == PLATFORM_PROFILE_LAST)
> return -EINVAL;
>
> @@ -515,7 +517,8 @@ int platform_profile_cycle(void)
> if (err)
> return err;
>
> - /* never iterate into a custom if all drivers supported it */
> + /* never iterate into a custom or max power if all drivers supported it */
> + clear_bit(PLATFORM_PROFILE_MAX_POWER, data.aggregate);
> clear_bit(PLATFORM_PROFILE_CUSTOM, data.aggregate);
>
> next = find_next_bit_wrap(data.aggregate,
> diff --git a/include/linux/platform_profile.h b/include/linux/platform_profile.h
> index a299225ab92e..855b28340e95 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_MAX_POWER,
> PLATFORM_PROFILE_CUSTOM,
> PLATFORM_PROFILE_LAST, /*must always be last */
> };
Powered by blists - more mailing lists