Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e8c0a89 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

cpufreq: governor: Check transition latecy at init time only



It is not necessary to check the governor's max_transition_latency
attribute every time cpufreq_governor() runs, so check it only if
the event argument is CPUFREQ_GOV_POLICY_INIT.

Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent d6ff44d6
Loading
Loading
Loading
Loading
+14 −13
Original line number Original line Diff line number Diff line
@@ -2011,6 +2011,7 @@ static int cpufreq_governor(struct cpufreq_policy *policy, unsigned int event)
	if (!policy->governor)
	if (!policy->governor)
		return -EINVAL;
		return -EINVAL;


	if (event == CPUFREQ_GOV_POLICY_INIT) {
		if (policy->governor->max_transition_latency &&
		if (policy->governor->max_transition_latency &&
		    policy->cpuinfo.transition_latency >
		    policy->cpuinfo.transition_latency >
		    policy->governor->max_transition_latency) {
		    policy->governor->max_transition_latency) {
@@ -2025,9 +2026,9 @@ static int cpufreq_governor(struct cpufreq_policy *policy, unsigned int event)
			}
			}
		}
		}


	if (event == CPUFREQ_GOV_POLICY_INIT)
		if (!try_module_get(policy->governor->owner))
		if (!try_module_get(policy->governor->owner))
			return -EINVAL;
			return -EINVAL;
	}


	pr_debug("%s: for CPU %u, event %u\n", __func__, policy->cpu, event);
	pr_debug("%s: for CPU %u, event %u\n", __func__, policy->cpu, event);