Commit c2125f72 authored by Viresh Kumar's avatar Viresh Kumar Committed by Greg Kroah-Hartman

cpufreq: update 'cpufreq_suspended' after stopping governors

commit b1b12bab upstream.

Commit 8e30444e ("cpufreq: fix cpufreq suspend/resume for intel_pstate")
introduced a bug where the governors wouldn't be stopped anymore for
->target{_index}() drivers during suspend. This happens because
'cpufreq_suspended' is updated before stopping the governors during suspend
and due to this __cpufreq_governor() would return early due to this check:

	/* Don't start any governor operations if we are entering suspend */
	if (cpufreq_suspended)
		return 0;

Fixes: 8e30444e ("cpufreq: fix cpufreq suspend/resume for intel_pstate")
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9b117b10
...@@ -1666,10 +1666,8 @@ void cpufreq_suspend(void) ...@@ -1666,10 +1666,8 @@ void cpufreq_suspend(void)
if (!cpufreq_driver) if (!cpufreq_driver)
return; return;
cpufreq_suspended = true;
if (!has_target()) if (!has_target())
return; goto suspend;
pr_debug("%s: Suspending Governors\n", __func__); pr_debug("%s: Suspending Governors\n", __func__);
...@@ -1682,6 +1680,9 @@ void cpufreq_suspend(void) ...@@ -1682,6 +1680,9 @@ void cpufreq_suspend(void)
pr_err("%s: Failed to suspend driver: %p\n", __func__, pr_err("%s: Failed to suspend driver: %p\n", __func__,
policy); policy);
} }
suspend:
cpufreq_suspended = true;
} }
/** /**
......
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