Re: [PATCH v5 3/3] cpufreq/amd-pstate: Cache the firmware programmed EPP value
From: K Prateek Nayak
Date: Tue Jun 09 2026 - 00:55:30 EST
Hello Marco,
On 6/8/2026 1:01 PM, Marco Scardovi wrote:
> At CPU EPP initialization, the private cpudata structure is allocated via
> kzalloc, which means cpudata->cppc_req_cached is initialized to 0. This
> makes the default cached EPP value 0 (AMD_CPPC_EPP_PERFORMANCE).
>
> When initializing a system that defaults to performance EPP, the driver
> attempts to configure the EPP via amd_pstate_set_epp(). Because the
> requested EPP (0) matches the uninitialized cached value (0), the cache
> guard check triggers, and the driver skips writing to the hardware.
>
> On shared memory systems, skipping the EPP write consequently skips
> enabling auto_sel, leaving the CPU in non-autonomous mode.
nit. this paragraph is unnecessary since you've fixed it in previous
patch but Mario can drop it when he is including it in his tree so
no biggie.
>
> Cache the firmware-programmed default EPP value in cppc_req_cached during
> CPU EPP initialization. This saves on an unnecessary reprogramming later
> when the EPP is first set.
>
> Assisted-by: Antigravity:gemini-3.5-flash
> Signed-off-by: Marco Scardovi <scardracs@xxxxxxxxxxx>
Feel free to include:
Reviewed-by: K Prateek Nayak <kprateek.nayak@xxxxxxx>
--
Thanks and Regards,
Prateek