diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-08-18 09:35:59 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-08-18 09:35:59 -0400 |
commit | 878f6e074e9a7784a6e351512eace4ccb3542eef (patch) | |
tree | 7a22a91465ec075f537a02c29407457aeeabaab5 /drivers/cpufreq | |
parent | 0e25246fb3d7455dc3405435da70156370e285ec (diff) |
Revert "cpufreq: Use cpufreq_policy_list for iterating over policies"
Revert commit eb60852 (cpufreq: Use cpufreq_policy_list for iterating
over policies), because it breaks system suspend/resume on multiple
machines.
It either causes resume to block indefinitely or causes the BUG_ON()
in lock_policy_rwsem_##mode() to trigger on sysfs accesses to cpufreq
attributes.
Conflicts:
drivers/cpufreq/cpufreq.c
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 37a687467329..c0ef84d601b7 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -969,8 +969,8 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif, | |||
969 | struct cpufreq_policy *policy; | 969 | struct cpufreq_policy *policy; |
970 | unsigned long flags; | 970 | unsigned long flags; |
971 | #ifdef CONFIG_HOTPLUG_CPU | 971 | #ifdef CONFIG_HOTPLUG_CPU |
972 | struct cpufreq_policy *tpolicy; | ||
973 | struct cpufreq_governor *gov; | 972 | struct cpufreq_governor *gov; |
973 | int sibling; | ||
974 | #endif | 974 | #endif |
975 | 975 | ||
976 | if (cpu_is_offline(cpu)) | 976 | if (cpu_is_offline(cpu)) |
@@ -993,10 +993,11 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif, | |||
993 | #ifdef CONFIG_HOTPLUG_CPU | 993 | #ifdef CONFIG_HOTPLUG_CPU |
994 | /* Check if this cpu was hot-unplugged earlier and has siblings */ | 994 | /* Check if this cpu was hot-unplugged earlier and has siblings */ |
995 | read_lock_irqsave(&cpufreq_driver_lock, flags); | 995 | read_lock_irqsave(&cpufreq_driver_lock, flags); |
996 | list_for_each_entry(tpolicy, &cpufreq_policy_list, policy_list) { | 996 | for_each_online_cpu(sibling) { |
997 | if (cpumask_test_cpu(cpu, tpolicy->related_cpus)) { | 997 | struct cpufreq_policy *cp = per_cpu(cpufreq_cpu_data, sibling); |
998 | if (cp && cpumask_test_cpu(cpu, cp->related_cpus)) { | ||
998 | read_unlock_irqrestore(&cpufreq_driver_lock, flags); | 999 | read_unlock_irqrestore(&cpufreq_driver_lock, flags); |
999 | ret = cpufreq_add_policy_cpu(tpolicy, cpu, dev, frozen); | 1000 | ret = cpufreq_add_policy_cpu(cp, cpu, dev, frozen); |
1000 | up_read(&cpufreq_rwsem); | 1001 | up_read(&cpufreq_rwsem); |
1001 | return ret; | 1002 | return ret; |
1002 | } | 1003 | } |