Commit 220abf7
cpufreq/amd-pstate: Fix setting of CPPC.min_perf in active mode for performance governor
In the "active" mode of the amd-pstate driver with performance
governor, the CPPC.min_perf is expected to be the nominal_perf.
However after commit a9b9b4c ("cpufreq/amd-pstate: Drop min and
max cached frequencies"), this is not the case when the governor is
switched from performance to powersave and back to performance, and
the CPPC.min_perf will be equal to the scaling_min_freq that was set
for the powersave governor.
This is because prior to commit a9b9b4c ("cpufreq/amd-pstate:
Drop min and max cached frequencies"), amd_pstate_epp_update_limit()
would unconditionally call amd_pstate_update_min_max_limit() and the
latter function would enforce the CPPC.min_perf constraint when the
governor is performance.
However, after the aforementioned commit,
amd_pstate_update_min_max_limit() is called by
amd_pstate_epp_update_limit() only when either the
scaling_{min/max}_freq is different from the cached value of
cpudata->{min/max}_limit_freq, which wouldn't have changed on a
governor transition from powersave to performance, thus missing out on
enforcing the CPPC.min_perf constraint for the performance governor.
Fix this by invoking amd_pstate_epp_udpate_limit() not only when the
{min/max} limits have changed from the cached values, but also when
the policy itself has changed.
Fixes: a9b9b4c ("cpufreq/amd-pstate: Drop min and max cached frequencies")
Signed-off-by: Gautham R. Shenoy <[email protected]>
Reviewed-by: Mario Limonciello <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mario Limonciello (AMD) <[email protected]>1 parent c17b750 commit 220abf7
1 file changed
+6
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1554 | 1554 | | |
1555 | 1555 | | |
1556 | 1556 | | |
1557 | | - | |
| 1557 | + | |
1558 | 1558 | | |
1559 | 1559 | | |
1560 | 1560 | | |
1561 | 1561 | | |
1562 | 1562 | | |
1563 | | - | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
1564 | 1566 | | |
1565 | 1567 | | |
1566 | 1568 | | |
| |||
1584 | 1586 | | |
1585 | 1587 | | |
1586 | 1588 | | |
1587 | | - | |
| 1589 | + | |
1588 | 1590 | | |
1589 | 1591 | | |
1590 | 1592 | | |
| |||
1658 | 1660 | | |
1659 | 1661 | | |
1660 | 1662 | | |
1661 | | - | |
| 1663 | + | |
1662 | 1664 | | |
1663 | 1665 | | |
1664 | 1666 | | |
| |||
0 commit comments