diff options
author | Lan Tianyu <tianyu.lan@intel.com> | 2014-09-18 03:03:07 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-09-22 08:23:18 -0400 |
commit | 8e30444e153008e8eb3e74cbcb7a865bfcfb04a0 (patch) | |
tree | 3e63816efa5d70f4343d7018683b9c4b7fe51322 /drivers/cpufreq | |
parent | 0f33be009b89d2268e94194dc4fd01a7851b6d51 (diff) |
cpufreq: fix cpufreq suspend/resume for intel_pstate
Cpufreq core introduces cpufreq_suspended flag to let cpufreq sysfs nodes
across S2RAM/S2DISK. But the flag is only set in the cpufreq_suspend()
for cpufreq drivers which have target or target_index callback. This
skips intel_pstate driver. This patch is to set the flag before checking
target or target_index callback.
Fixes: 2f0aea936360 (cpufreq: suspend governors on system suspend/hibernate)
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Cc: 3.15+ <stable@vger.kernel.org> # 3.15+
[rjw: Subject]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index d9fdeddcef96..eb9bb7848e50 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -1656,6 +1656,8 @@ void cpufreq_suspend(void) | |||
1656 | if (!cpufreq_driver) | 1656 | if (!cpufreq_driver) |
1657 | return; | 1657 | return; |
1658 | 1658 | ||
1659 | cpufreq_suspended = true; | ||
1660 | |||
1659 | if (!has_target()) | 1661 | if (!has_target()) |
1660 | return; | 1662 | return; |
1661 | 1663 | ||
@@ -1670,8 +1672,6 @@ void cpufreq_suspend(void) | |||
1670 | pr_err("%s: Failed to suspend driver: %p\n", __func__, | 1672 | pr_err("%s: Failed to suspend driver: %p\n", __func__, |
1671 | policy); | 1673 | policy); |
1672 | } | 1674 | } |
1673 | |||
1674 | cpufreq_suspended = true; | ||
1675 | } | 1675 | } |
1676 | 1676 | ||
1677 | /** | 1677 | /** |
@@ -1687,13 +1687,13 @@ void cpufreq_resume(void) | |||
1687 | if (!cpufreq_driver) | 1687 | if (!cpufreq_driver) |
1688 | return; | 1688 | return; |
1689 | 1689 | ||
1690 | cpufreq_suspended = false; | ||
1691 | |||
1690 | if (!has_target()) | 1692 | if (!has_target()) |
1691 | return; | 1693 | return; |
1692 | 1694 | ||
1693 | pr_debug("%s: Resuming Governors\n", __func__); | 1695 | pr_debug("%s: Resuming Governors\n", __func__); |
1694 | 1696 | ||
1695 | cpufreq_suspended = false; | ||
1696 | |||
1697 | list_for_each_entry(policy, &cpufreq_policy_list, policy_list) { | 1697 | list_for_each_entry(policy, &cpufreq_policy_list, policy_list) { |
1698 | if (cpufreq_driver->resume && cpufreq_driver->resume(policy)) | 1698 | if (cpufreq_driver->resume && cpufreq_driver->resume(policy)) |
1699 | pr_err("%s: Failed to resume driver: %p\n", __func__, | 1699 | pr_err("%s: Failed to resume driver: %p\n", __func__, |