Skip to content

Commit

Permalink
tools/power/x86/intel-speed-select: Set TRL MSR in 100 MHz units
Browse files Browse the repository at this point in the history
When SST-TF is disabled in auto mode, the performance is getting
limited.

This is caused by wrong programming of Turbo Ratio Limit (TRL) MSR.

This MSR always accepts the frequency ratio in 100 MHz unit. When the
TPMI is sending TRL in 1 MHz unit, change to 100 MHz, before updating
TRL MSR.

Signed-off-by: Srinivas Pandruvada <[email protected]>
  • Loading branch information
spandruvada committed Jul 7, 2024
1 parent cf25477 commit fd77d7f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/power/x86/intel-speed-select/isst-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ int isst_set_trl(struct isst_id *id, unsigned long long trl)
return 0;
}

#define MSR_TRL_FREQ_MULTIPLIER 100

int isst_set_trl_from_current_tdp(struct isst_id *id, unsigned long long trl)
{
unsigned long long msr_trl;
Expand Down Expand Up @@ -310,6 +312,10 @@ int isst_set_trl_from_current_tdp(struct isst_id *id, unsigned long long trl)
for (i = 0; i < 8; ++i) {
unsigned long long _trl = trl[i];

/* MSR is always in 100 MHz unit */
if (isst_get_disp_freq_multiplier() == 1)
_trl /= MSR_TRL_FREQ_MULTIPLIER;

msr_trl |= (_trl << (i * 8));
}
}
Expand Down

0 comments on commit fd77d7f

Please sign in to comment.