aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-09-09 20:54:50 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-09-09 20:54:50 -0400
commit798282a8718347b04a2f0a4bae7d775c48c6bcb9 (patch)
treefd296df6b0ad8fb74de6aeedbaa83ca1cff941e0
parent5136fa56582beadb7fa71eb30bc79148bfcba5c1 (diff)
Revert "cpufreq: make sure frequency transitions are serialized"
Commit 7c30ed5 (cpufreq: make sure frequency transitions are serialized) attempted to serialize frequency transitions by adding checks to the CPUFREQ_PRECHANGE and CPUFREQ_POSTCHANGE notifications. However, it assumed that the notifications will always originate from the driver's .target() callback, but they also can be triggered by cpufreq_out_of_sync() and that leads to warnings like this on some systems: WARNING: CPU: 0 PID: 14543 at drivers/cpufreq/cpufreq.c:317 __cpufreq_notify_transition+0x238/0x260() In middle of another frequency transition accompanied by a call trace similar to this one: [<ffffffff81720daa>] dump_stack+0x46/0x58 [<ffffffff8106534c>] warn_slowpath_common+0x8c/0xc0 [<ffffffff815b8560>] ? acpi_cpufreq_target+0x320/0x320 [<ffffffff81065436>] warn_slowpath_fmt+0x46/0x50 [<ffffffff815b1ec8>] __cpufreq_notify_transition+0x238/0x260 [<ffffffff815b33be>] cpufreq_notify_transition+0x3e/0x70 [<ffffffff815b345d>] cpufreq_out_of_sync+0x6d/0xb0 [<ffffffff815b370c>] cpufreq_update_policy+0x10c/0x160 [<ffffffff815b3760>] ? cpufreq_update_policy+0x160/0x160 [<ffffffff81413813>] cpufreq_set_cur_state+0x8c/0xb5 [<ffffffff814138df>] processor_set_cur_state+0xa3/0xcf [<ffffffff8158e13c>] thermal_cdev_update+0x9c/0xb0 [<ffffffff8159046a>] step_wise_throttle+0x5a/0x90 [<ffffffff8158e21f>] handle_thermal_trip+0x4f/0x140 [<ffffffff8158e377>] thermal_zone_device_update+0x57/0xa0 [<ffffffff81415b36>] acpi_thermal_check+0x2e/0x30 [<ffffffff81415ca0>] acpi_thermal_notify+0x40/0xdc [<ffffffff813e7dbd>] acpi_device_notify+0x19/0x1b [<ffffffff813f8241>] acpi_ev_notify_dispatch+0x41/0x5c [<ffffffff813e3fbe>] acpi_os_execute_deferred+0x25/0x32 [<ffffffff81081060>] process_one_work+0x170/0x4a0 [<ffffffff81082121>] worker_thread+0x121/0x390 [<ffffffff81082000>] ? manage_workers.isra.20+0x170/0x170 [<ffffffff81088fe0>] kthread+0xc0/0xd0 [<ffffffff81088f20>] ? flush_kthread_worker+0xb0/0xb0 [<ffffffff8173582c>] ret_from_fork+0x7c/0xb0 [<ffffffff81088f20>] ? flush_kthread_worker+0xb0/0xb0 For this reason, revert commit 7c30ed5 along with the fix 266c13d (cpufreq: Fix serialization of frequency transitions) on top of it and we will revisit the serialization problem later. Reported-by: Alessandro Bono <alessandro.bono@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/cpufreq/cpufreq.c15
-rw-r--r--include/linux/cpufreq.h1
2 files changed, 0 insertions, 16 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 73d53d5a16ee..5a64f66d36e0 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -280,13 +280,6 @@ static void __cpufreq_notify_transition(struct cpufreq_policy *policy,
280 switch (state) { 280 switch (state) {
281 281
282 case CPUFREQ_PRECHANGE: 282 case CPUFREQ_PRECHANGE:
283 if (WARN(policy->transition_ongoing ==
284 cpumask_weight(policy->cpus),
285 "In middle of another frequency transition\n"))
286 return;
287
288 policy->transition_ongoing++;
289
290 /* detect if the driver reported a value as "old frequency" 283 /* detect if the driver reported a value as "old frequency"
291 * which is not equal to what the cpufreq core thinks is 284 * which is not equal to what the cpufreq core thinks is
292 * "old frequency". 285 * "old frequency".
@@ -306,12 +299,6 @@ static void __cpufreq_notify_transition(struct cpufreq_policy *policy,
306 break; 299 break;
307 300
308 case CPUFREQ_POSTCHANGE: 301 case CPUFREQ_POSTCHANGE:
309 if (WARN(!policy->transition_ongoing,
310 "No frequency transition in progress\n"))
311 return;
312
313 policy->transition_ongoing--;
314
315 adjust_jiffies(CPUFREQ_POSTCHANGE, freqs); 302 adjust_jiffies(CPUFREQ_POSTCHANGE, freqs);
316 pr_debug("FREQ: %lu - CPU: %lu", (unsigned long)freqs->new, 303 pr_debug("FREQ: %lu - CPU: %lu", (unsigned long)freqs->new,
317 (unsigned long)freqs->cpu); 304 (unsigned long)freqs->cpu);
@@ -1657,8 +1644,6 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
1657 1644
1658 if (cpufreq_disabled()) 1645 if (cpufreq_disabled())
1659 return -ENODEV; 1646 return -ENODEV;
1660 if (policy->transition_ongoing)
1661 return -EBUSY;
1662 1647
1663 /* Make sure that target_freq is within supported range */ 1648 /* Make sure that target_freq is within supported range */
1664 if (target_freq > policy->max) 1649 if (target_freq > policy->max)
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index d568f3975eeb..fcabc42d66ab 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -85,7 +85,6 @@ struct cpufreq_policy {
85 struct list_head policy_list; 85 struct list_head policy_list;
86 struct kobject kobj; 86 struct kobject kobj;
87 struct completion kobj_unregister; 87 struct completion kobj_unregister;
88 int transition_ongoing; /* Tracks transition status */
89}; 88};
90 89
91/* Only for ACPI */ 90/* Only for ACPI */