Skip to content

Commit

Permalink
platform/x86/amd/pmf: Remove unused power_delta instances
Browse files Browse the repository at this point in the history
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: 1738061 ("platform/x86/amd/pmf: Add support for CnQF")
Signed-off-by: Shyam Sundar S K <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
  • Loading branch information
Shyam Sundar S K authored and jwrdegoede committed Sep 27, 2022
1 parent 1590ac2 commit 9732f9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
12 changes: 6 additions & 6 deletions drivers/platform/x86/amd/pmf/cnqf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 0 additions & 11 deletions drivers/platform/x86/amd/pmf/pmf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
};
Expand Down

0 comments on commit 9732f9c

Please sign in to comment.