@@ -251,24 +251,26 @@ static int amd_pstate_get_energy_pref_index(struct amd_cpudata *cpudata)
251251 return index ;
252252}
253253
254- static void msr_update_perf (struct amd_cpudata * cpudata , u32 min_perf ,
254+ static int msr_update_perf (struct amd_cpudata * cpudata , u32 min_perf ,
255255 u32 des_perf , u32 max_perf , bool fast_switch )
256256{
257- if (fast_switch )
257+ if (fast_switch ) {
258258 wrmsrl (MSR_AMD_CPPC_REQ , READ_ONCE (cpudata -> cppc_req_cached ));
259- else
260- wrmsrl_on_cpu (cpudata -> cpu , MSR_AMD_CPPC_REQ ,
261- READ_ONCE (cpudata -> cppc_req_cached ));
259+ return 0 ;
260+ }
261+
262+ return wrmsrl_on_cpu (cpudata -> cpu , MSR_AMD_CPPC_REQ ,
263+ READ_ONCE (cpudata -> cppc_req_cached ));
262264}
263265
264266DEFINE_STATIC_CALL (amd_pstate_update_perf , msr_update_perf );
265267
266- static inline void amd_pstate_update_perf (struct amd_cpudata * cpudata ,
268+ static inline int amd_pstate_update_perf (struct amd_cpudata * cpudata ,
267269 u32 min_perf , u32 des_perf ,
268270 u32 max_perf , bool fast_switch )
269271{
270- static_call (amd_pstate_update_perf )(cpudata , min_perf , des_perf ,
271- max_perf , fast_switch );
272+ return static_call (amd_pstate_update_perf )(cpudata , min_perf , des_perf ,
273+ max_perf , fast_switch );
272274}
273275
274276static int msr_set_epp (struct amd_cpudata * cpudata , u32 epp )
@@ -480,7 +482,7 @@ static inline int amd_pstate_init_perf(struct amd_cpudata *cpudata)
480482 return static_call (amd_pstate_init_perf )(cpudata );
481483}
482484
483- static void shmem_update_perf (struct amd_cpudata * cpudata ,
485+ static int shmem_update_perf (struct amd_cpudata * cpudata ,
484486 u32 min_perf , u32 des_perf ,
485487 u32 max_perf , bool fast_switch )
486488{
@@ -490,7 +492,7 @@ static void shmem_update_perf(struct amd_cpudata *cpudata,
490492 perf_ctrls .min_perf = min_perf ;
491493 perf_ctrls .desired_perf = des_perf ;
492494
493- cppc_set_perf (cpudata -> cpu , & perf_ctrls );
495+ return cppc_set_perf (cpudata -> cpu , & perf_ctrls );
494496}
495497
496498static inline bool amd_pstate_sample (struct amd_cpudata * cpudata )
0 commit comments