All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
To: <hdegoede@redhat.com>, <markgross@kernel.org>,
	<mario.limonciello@amd.com>
Cc: <platform-driver-x86@vger.kernel.org>, <Patil.Reddy@amd.com>,
	<bnocera@redhat.com>, Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Subject: [PATCH] platform/x86/amd/pmf: Remove unused power_delta instances
Date: Thu, 22 Sep 2022 22:21:18 +0530	[thread overview]
Message-ID: <20220922165118.163165-1-Shyam-sundar.S-k@amd.com> (raw)

Initial version of the PMF ACPI documentation had the concept
of "power_delta" which is removed in the recent revisions.

So the entire cnqf_power_delta structure is never used/updated.
Hence removing it.

Fixes: 1738061c9ec8 ("platform/x86/amd/pmf: Add support for CnQF")
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
---
 drivers/platform/x86/amd/pmf/cnqf.c | 12 ++++++------
 drivers/platform/x86/amd/pmf/pmf.h  | 11 -----------
 2 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/drivers/platform/x86/amd/pmf/cnqf.c b/drivers/platform/x86/amd/pmf/cnqf.c
index 927f3c8cd971..668c7c0fea83 100644
--- a/drivers/platform/x86/amd/pmf/cnqf.c
+++ b/drivers/platform/x86/amd/pmf/cnqf.c
@@ -45,27 +45,27 @@ static void amd_pmf_update_power_threshold(int src)
 
 	tp = &config_store.trans_param[src][CNQF_TRANSITION_TO_QUIET];
 	ts = &config_store.mode_set[src][CNQF_MODE_BALANCE];
-	tp->power_threshold = ts->power_floor - tp->power_delta;
+	tp->power_threshold = ts->power_floor;
 
 	tp = &config_store.trans_param[src][CNQF_TRANSITION_TO_TURBO];
 	ts = &config_store.mode_set[src][CNQF_MODE_PERFORMANCE];
-	tp->power_threshold = ts->power_floor - tp->power_delta;
+	tp->power_threshold = ts->power_floor;
 
 	tp = &config_store.trans_param[src][CNQF_TRANSITION_FROM_BALANCE_TO_PERFORMANCE];
 	ts = &config_store.mode_set[src][CNQF_MODE_BALANCE];
-	tp->power_threshold = ts->power_floor - tp->power_delta;
+	tp->power_threshold = ts->power_floor;
 
 	tp = &config_store.trans_param[src][CNQF_TRANSITION_FROM_PERFORMANCE_TO_BALANCE];
 	ts = &config_store.mode_set[src][CNQF_MODE_PERFORMANCE];
-	tp->power_threshold = ts->power_floor - tp->power_delta;
+	tp->power_threshold = ts->power_floor;
 
 	tp = &config_store.trans_param[src][CNQF_TRANSITION_FROM_QUIET_TO_BALANCE];
 	ts = &config_store.mode_set[src][CNQF_MODE_QUIET];
-	tp->power_threshold = ts->power_floor - tp->power_delta;
+	tp->power_threshold = ts->power_floor;
 
 	tp = &config_store.trans_param[src][CNQF_TRANSITION_FROM_TURBO_TO_PERFORMANCE];
 	ts = &config_store.mode_set[src][CNQF_MODE_TURBO];
-	tp->power_threshold = ts->power_floor - tp->power_delta;
+	tp->power_threshold = ts->power_floor;
 }
 
 static const char *state_as_str(unsigned int state)
diff --git a/drivers/platform/x86/amd/pmf/pmf.h b/drivers/platform/x86/amd/pmf/pmf.h
index 097f3f5d33a3..e5dc3ae238c7 100644
--- a/drivers/platform/x86/amd/pmf/pmf.h
+++ b/drivers/platform/x86/amd/pmf/pmf.h
@@ -333,7 +333,6 @@ struct cnqf_mode_settings {
 
 struct cnqf_tran_params {
 	u32 time_constant; /* minimum time required to switch to next mode */
-	u32 power_delta; /* minimum power required to switch to next mode */
 	u32 power_threshold;
 	u32 timer; /* elapsed time. if timer > timethreshold, it will move to next mode */
 	u32 total_power;
@@ -343,21 +342,11 @@ struct cnqf_tran_params {
 	enum cnqf_mode target_mode;
 };
 
-struct cnqf_power_delta {
-	u32 to_turbo;
-	u32 balance_to_perf;
-	u32 quiet_to_balance;
-	u32 to_quiet;
-	u32 perf_to_balance;
-	u32 turbo_to_perf;
-};
-
 struct cnqf_config {
 	struct cnqf_tran_params trans_param[POWER_SOURCE_MAX][CNQF_TRANSITION_MAX];
 	struct cnqf_mode_settings mode_set[POWER_SOURCE_MAX][CNQF_MODE_MAX];
 	struct power_table_control defaults;
 	enum cnqf_mode current_mode;
-	struct cnqf_power_delta power_delta[POWER_SOURCE_MAX];
 	u32 power_src;
 	u32 avg_power;
 };
-- 
2.25.1


             reply	other threads:[~2022-09-22 16:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22 16:51 Shyam Sundar S K [this message]
2022-09-27 12:59 ` [PATCH] platform/x86/amd/pmf: Remove unused power_delta instances Hans de Goede

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=20220922165118.163165-1-Shyam-sundar.S-k@amd.com \
    --to=shyam-sundar.s-k@amd.com \
    --cc=Patil.Reddy@amd.com \
    --cc=bnocera@redhat.com \
    --cc=hdegoede@redhat.com \
    --cc=mario.limonciello@amd.com \
    --cc=markgross@kernel.org \
    --cc=platform-driver-x86@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.