From 0c5aa405a9437d97e09ec289d4f29bb62e0f01b6 Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Mon, 24 Mar 2014 12:30:29 +0530 Subject: cpufreq: resume drivers before enabling governors During suspend, we first stop governors and then suspend cpufreq drivers and resume must be exactly opposite of that. i.e. resume drivers first and then start governors. But the current code in resume enables governors first and then resume drivers. Fix it be changing code sequence there. Signed-off-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki --- drivers/cpufreq/cpufreq.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'drivers/cpufreq') diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 3aa7a7a..d8d6bc9 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1652,14 +1652,13 @@ void cpufreq_resume(void) cpufreq_suspended = false; list_for_each_entry(policy, &cpufreq_policy_list, policy_list) { - if (__cpufreq_governor(policy, CPUFREQ_GOV_START) + if (cpufreq_driver->resume && cpufreq_driver->resume(policy)) + pr_err("%s: Failed to resume driver: %p\n", __func__, + policy); + else if (__cpufreq_governor(policy, CPUFREQ_GOV_START) || __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS)) pr_err("%s: Failed to start governor for policy: %p\n", __func__, policy); - else if (cpufreq_driver->resume - && cpufreq_driver->resume(policy)) - pr_err("%s: Failed to resume driver: %p\n", __func__, - policy); /* * schedule call cpufreq_update_policy() for boot CPU, i.e. last -- cgit v1.1