@@ -251,24 +251,26 @@ static int amd_pstate_get_energy_pref_index(struct amd_cpudata *cpudata)
251
251
return index ;
252
252
}
253
253
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 ,
255
255
u32 des_perf , u32 max_perf , bool fast_switch )
256
256
{
257
- if (fast_switch )
257
+ if (fast_switch ) {
258
258
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 ));
262
264
}
263
265
264
266
DEFINE_STATIC_CALL (amd_pstate_update_perf , msr_update_perf );
265
267
266
- static inline void amd_pstate_update_perf (struct amd_cpudata * cpudata ,
268
+ static inline int amd_pstate_update_perf (struct amd_cpudata * cpudata ,
267
269
u32 min_perf , u32 des_perf ,
268
270
u32 max_perf , bool fast_switch )
269
271
{
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 );
272
274
}
273
275
274
276
static 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)
480
482
return static_call (amd_pstate_init_perf )(cpudata );
481
483
}
482
484
483
- static void shmem_update_perf (struct amd_cpudata * cpudata ,
485
+ static int shmem_update_perf (struct amd_cpudata * cpudata ,
484
486
u32 min_perf , u32 des_perf ,
485
487
u32 max_perf , bool fast_switch )
486
488
{
@@ -490,7 +492,7 @@ static void shmem_update_perf(struct amd_cpudata *cpudata,
490
492
perf_ctrls .min_perf = min_perf ;
491
493
perf_ctrls .desired_perf = des_perf ;
492
494
493
- cppc_set_perf (cpudata -> cpu , & perf_ctrls );
495
+ return cppc_set_perf (cpudata -> cpu , & perf_ctrls );
494
496
}
495
497
496
498
static inline bool amd_pstate_sample (struct amd_cpudata * cpudata )
0 commit comments