Re: [PATCH v5 1/3] cpufreq/amd-pstate: Fix EPP return type and handle errors during initialization

From: K Prateek Nayak

Date: Tue Jun 09 2026 - 00:50:35 EST


Hello Marco,

On 6/8/2026 1:01 PM, Marco Scardovi wrote:
> Currently, the EPP getter helper functions (msr_get_epp, shmem_get_epp, and
> the static call wrapper amd_pstate_get_epp) return u8 or s16. This makes it
> difficult to correctly propagate negative error values returned by the
> underlying MSR read or CPPC helpers (such as rdmsrq_on_cpu or
> cppc_get_epp_perf).
>
> Modify the return type of these functions to int, allowing them to return
> negative error codes properly.
>
> Additionally, in amd_pstate_epp_cpu_init(), fetch the firmware-programmed
> default EPP value and validate it before assigning it to the EPP variables.
> If amd_pstate_get_epp() returns an error code, propagate the error and abort
> the CPU initialization to prevent subsequent configuration failures.
>
> Fixes: 555bbe67a622 ("cpufreq/amd-pstate: Convert all perf values to u8")
> Assisted-by: Antigravity:gemini-3.5-flash
> Signed-off-by: Marco Scardovi <scardracs@xxxxxxxxxxx>

Thank you for your patience during the debug and helping chase these
issues down. Feel free to include:

Reviewed-by: K Prateek Nayak <kprateek.anayk@xxxxxxx>

--
Thanks and Regards,
Prateek