Skip to content

Commit

Permalink
power: handle frequency increase with turbo disabled
Browse files Browse the repository at this point in the history
[ upstream commit 388c4c0 ]

Calling pstate's or acpi's rte_power_freq_up() when on the highest
non-turbo frequency results in an error, if turbo is enabled in the BIOS,
but disabled via the power library.
The error is in the form of a return code and a RTE_LOG() entry
on the ERR level.

According to the API documentation, the frequency is scaled up
"according to the available frequencies". In case turbo is disabled,
that frequency is not available. This patch's rte_power_freq_up()
behaviour is also consistent with how rte_power_freq_max() is
implemented (i.e. the highest non-turbo frequency is set, in case
turbo is disabled).

Fixes: 445c652 ("power: common interface for guest and host")
Fixes: e6c6dc0 ("power: add p-state driver compatibility")

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
Reviewed-by: Liang Ma <liang.j.ma@intel.com>
  • Loading branch information
m-ronnblom authored and kevintraynor committed Dec 11, 2019
1 parent df025f6 commit 65ce5cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/librte_power/power_acpi_cpufreq.c
Expand Up @@ -505,7 +505,8 @@ power_acpi_cpufreq_freq_up(unsigned int lcore_id)
}

pi = &lcore_power_info[lcore_id];
if (pi->curr_idx == 0)
if (pi->curr_idx == 0 ||
(pi->curr_idx == 1 && pi->turbo_available && !pi->turbo_enable))
return 0;

/* Frequencies in the array are from high to low. */
Expand Down

0 comments on commit 65ce5cd

Please sign in to comment.