diff options
author | 2025-02-22 03:32:22 +0000 | |
---|---|---|
committer | 2025-03-06 13:01:17 -0600 | |
commit | a1d1d8fb653532638cfb3ee0b7e67ebd5327a3d6 (patch) | |
tree | 342a54e5dc9b109cd3d0d44261341a9f450972cd /tools/perf/scripts/python/call-graph-from-postgresql.py | |
parent | cpufreq/amd-pstate: Remove the unncecessary driver_lock in amd_pstate_update_limits (diff) | |
download | wireguard-linux-a1d1d8fb653532638cfb3ee0b7e67ebd5327a3d6.tar.xz wireguard-linux-a1d1d8fb653532638cfb3ee0b7e67ebd5327a3d6.zip |
cpufreq/amd-pstate: Fix the clamping of perf values
The clamping in freq_to_perf() is broken right now, as we first typecast
(read wraparound) the overflowing value into a u8 and then clamp it down.
So, use a u32 to store the >255 value in certain edge cases and then clamp
it down into a u8.
Also, use a "explicit typecast + clamp" instead of just a "clamp_t" as the
latter typecasts first and then clamps between the limits, which defeats
our purpose.
Fixes: 620136ced35a ("cpufreq/amd-pstate: Modularize perf<->freq conversion")
Signed-off-by: Dhananjay Ugwekar <dhananjay.ugwekar@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20250222033221.554976-1-dhananjay.ugwekar@amd.com
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Diffstat (limited to 'tools/perf/scripts/python/call-graph-from-postgresql.py')
0 files changed, 0 insertions, 0 deletions