Commit c3e093ef authored by Mario Limonciello's avatar Mario Limonciello

cpufreq/amd-pstate: Catch failures for amd_pstate_epp_update_limit()

amd_pstate_set_epp() calls cppc_set_epp_perf() which can fail for
a variety of reasons but this is ignored.  Change the return flow
to allow failures.
Reviewed-by: default avatarPerry Yuan <perry.yuan@amd.com>
Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
parent 431c1646
...@@ -1555,7 +1555,7 @@ static void amd_pstate_epp_cpu_exit(struct cpufreq_policy *policy) ...@@ -1555,7 +1555,7 @@ static void amd_pstate_epp_cpu_exit(struct cpufreq_policy *policy)
pr_debug("CPU %d exiting\n", policy->cpu); pr_debug("CPU %d exiting\n", policy->cpu);
} }
static void amd_pstate_epp_update_limit(struct cpufreq_policy *policy) static int amd_pstate_epp_update_limit(struct cpufreq_policy *policy)
{ {
struct amd_cpudata *cpudata = policy->driver_data; struct amd_cpudata *cpudata = policy->driver_data;
u32 max_perf, min_perf, min_limit_perf, max_limit_perf; u32 max_perf, min_perf, min_limit_perf, max_limit_perf;
...@@ -1605,7 +1605,7 @@ static void amd_pstate_epp_update_limit(struct cpufreq_policy *policy) ...@@ -1605,7 +1605,7 @@ static void amd_pstate_epp_update_limit(struct cpufreq_policy *policy)
* This return value can only be negative for shared_memory * This return value can only be negative for shared_memory
* systems where EPP register read/write not supported. * systems where EPP register read/write not supported.
*/ */
return; return epp;
} }
if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE) if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE)
...@@ -1618,12 +1618,13 @@ static void amd_pstate_epp_update_limit(struct cpufreq_policy *policy) ...@@ -1618,12 +1618,13 @@ static void amd_pstate_epp_update_limit(struct cpufreq_policy *policy)
} }
WRITE_ONCE(cpudata->cppc_req_cached, value); WRITE_ONCE(cpudata->cppc_req_cached, value);
amd_pstate_set_epp(cpudata, epp); return amd_pstate_set_epp(cpudata, epp);
} }
static int amd_pstate_epp_set_policy(struct cpufreq_policy *policy) static int amd_pstate_epp_set_policy(struct cpufreq_policy *policy)
{ {
struct amd_cpudata *cpudata = policy->driver_data; struct amd_cpudata *cpudata = policy->driver_data;
int ret;
if (!policy->cpuinfo.max_freq) if (!policy->cpuinfo.max_freq)
return -ENODEV; return -ENODEV;
...@@ -1633,7 +1634,9 @@ static int amd_pstate_epp_set_policy(struct cpufreq_policy *policy) ...@@ -1633,7 +1634,9 @@ static int amd_pstate_epp_set_policy(struct cpufreq_policy *policy)
cpudata->policy = policy->policy; cpudata->policy = policy->policy;
amd_pstate_epp_update_limit(policy); ret = amd_pstate_epp_update_limit(policy);
if (ret)
return ret;
/* /*
* policy->cur is never updated with the amd_pstate_epp driver, but it * policy->cur is never updated with the amd_pstate_epp driver, but it
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment