public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <superm1@kernel.org>
To: "Shyam Sundar S K" <Shyam-sundar.S-k@amd.com>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	"Hans de Goede" <hdegoede@redhat.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Luke D . Jones" <luke@ljones.dev>,
	"Mark Pearson" <mpearson-lenovo@squebb.ca>
Cc: platform-driver-x86@vger.kernel.org (open list:AMD PMF DRIVER),
	linux-kernel@vger.kernel.org (open list),
	linux-acpi@vger.kernel.org (open list:ACPI),
	"Derek J . Clark" <derekjohn.clark@gmail.com>,
	Antheas Kapenekakis <lkml@antheas.dev>,
	me@kylegospodneti.ch, Denis Benato <benato.denis96@gmail.com>,
	Mario Limonciello <mario.limonciello@amd.com>
Subject: [RFC 1/2] ACPI: Add support for a 'custom' profile
Date: Wed, 25 Sep 2024 21:59:54 -0500	[thread overview]
Message-ID: <20240926025955.1728766-2-superm1@kernel.org> (raw)
In-Reply-To: <20240926025955.1728766-1-superm1@kernel.org>

From: Mario Limonciello <mario.limonciello@amd.com>

Introduce a new profile type called 'custom' that can be set to allow
changing settings outside of the standard profile settings.

The idea behind this is to enforce a state machine so that a user
can't set 'balanced' then manually change one APU setting and confuse
userspace because the system is no longer really behaving in balanced.

In practice the intention is that userspace would first set "custom"
followed by modifying any settings. If userspace wants to go back to
one of the predefined profiles then those profiles can be written to
/sys/firmware/acpi/platform_profile.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 Documentation/ABI/testing/sysfs-platform_profile | 1 +
 drivers/acpi/platform_profile.c                  | 1 +
 include/linux/platform_profile.h                 | 1 +
 3 files changed, 3 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-platform_profile b/Documentation/ABI/testing/sysfs-platform_profile
index baf1d125f9f8..13dfe8aadbe2 100644
--- a/Documentation/ABI/testing/sysfs-platform_profile
+++ b/Documentation/ABI/testing/sysfs-platform_profile
@@ -15,6 +15,7 @@ Description:	This file contains a space-separated list of profiles supported for
 					power consumption with a slight bias
 					towards performance
 		performance		High performance operation
+		custom			Custom profile tuned by the user
 		====================	========================================
 
 		Userspace may expect drivers to offer more than one of these
diff --git a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c
index d2f7fd7743a1..383f87c8c036 100644
--- a/drivers/acpi/platform_profile.c
+++ b/drivers/acpi/platform_profile.c
@@ -19,6 +19,7 @@ static const char * const profile_names[] = {
 	[PLATFORM_PROFILE_BALANCED] = "balanced",
 	[PLATFORM_PROFILE_BALANCED_PERFORMANCE] = "balanced-performance",
 	[PLATFORM_PROFILE_PERFORMANCE] = "performance",
+	[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 f5492ed413f3..61273b615419 100644
--- a/include/linux/platform_profile.h
+++ b/include/linux/platform_profile.h
@@ -23,6 +23,7 @@ enum platform_profile_option {
 	PLATFORM_PROFILE_BALANCED,
 	PLATFORM_PROFILE_BALANCED_PERFORMANCE,
 	PLATFORM_PROFILE_PERFORMANCE,
+	PLATFORM_PROFILE_CUSTOM,
 	PLATFORM_PROFILE_LAST, /*must always be last */
 };
 
-- 
2.43.0


  reply	other threads:[~2024-09-26  3:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-26  2:59 [RFC 0/2] "custom" ACPI platform profile support Mario Limonciello
2024-09-26  2:59 ` Mario Limonciello [this message]
2024-09-26  2:59 ` [RFC 2/2] platform/x86/amd: pmf: Add manual control support Mario Limonciello
2024-09-26  8:52   ` Antheas Kapenekakis
2024-09-26 18:53     ` Mario Limonciello
2024-09-27  4:01       ` Derek John Clark
2024-09-26 10:25   ` Shyam Sundar S K
2024-09-26 11:00     ` Antheas Kapenekakis
2024-09-26 18:09       ` Mario Limonciello
2024-09-27  8:44         ` Antheas Kapenekakis
2024-12-19 13:12   ` Antheas Kapenekakis
2024-12-19 14:49     ` Mario Limonciello
2024-12-19 15:24       ` Antheas Kapenekakis
2024-12-19 16:13         ` Mario Limonciello
2024-12-19 21:10           ` Antheas Kapenekakis
2024-12-19 21:21             ` Mario Limonciello
2024-12-19 21:27               ` Antheas Kapenekakis
2024-12-19 21:35                 ` Mario Limonciello
2024-09-26  8:40 ` [RFC 0/2] "custom" ACPI platform profile support Antheas Kapenekakis
2024-09-26  9:00   ` Antheas Kapenekakis
2024-09-26 13:58 ` Mark Pearson
2024-09-26 18:14   ` Mario Limonciello
2024-09-26 19:19     ` Mark Pearson
2024-09-26 19:41       ` Antheas Kapenekakis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240926025955.1728766-2-superm1@kernel.org \
    --to=superm1@kernel.org \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=benato.denis96@gmail.com \
    --cc=derekjohn.clark@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@antheas.dev \
    --cc=luke@ljones.dev \
    --cc=mario.limonciello@amd.com \
    --cc=me@kylegospodneti.ch \
    --cc=mpearson-lenovo@squebb.ca \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox