aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq.c
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2007-02-05 19:12:43 -0500
committerDave Jones <davej@redhat.com>2007-02-10 20:01:47 -0500
commitc120069779e3e35917c15393cf2847fa79811eb6 (patch)
tree9e1e5529b43c151ecc9d3743e5b51ff88eb52312 /drivers/cpufreq/cpufreq.c
parent86acd49aa128bd7a1d4362c256c21fbdc2d5b1a0 (diff)
[CPUFREQ] Remove hotplug cpu crap
The hotplug CPU locking in cpufreq is horrendous. No-one seems to care enough to fix it, so just remove it so that the 99.9% of the real world users of this code can use cpufreq without being bothered by warnings. Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r--drivers/cpufreq/cpufreq.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index a45cc89e387a..9bdcdbdcc0ad 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -415,12 +415,10 @@ static ssize_t store_##file_name \
415 if (ret != 1) \ 415 if (ret != 1) \
416 return -EINVAL; \ 416 return -EINVAL; \
417 \ 417 \
418 lock_cpu_hotplug(); \
419 mutex_lock(&policy->lock); \ 418 mutex_lock(&policy->lock); \
420 ret = __cpufreq_set_policy(policy, &new_policy); \ 419 ret = __cpufreq_set_policy(policy, &new_policy); \
421 policy->user_policy.object = policy->object; \ 420 policy->user_policy.object = policy->object; \
422 mutex_unlock(&policy->lock); \ 421 mutex_unlock(&policy->lock); \
423 unlock_cpu_hotplug(); \
424 \ 422 \
425 return ret ? ret : count; \ 423 return ret ? ret : count; \
426} 424}
@@ -479,8 +477,6 @@ static ssize_t store_scaling_governor (struct cpufreq_policy * policy,
479 &new_policy.governor)) 477 &new_policy.governor))
480 return -EINVAL; 478 return -EINVAL;
481 479
482 lock_cpu_hotplug();
483
484 /* Do not use cpufreq_set_policy here or the user_policy.max 480 /* Do not use cpufreq_set_policy here or the user_policy.max
485 will be wrongly overridden */ 481 will be wrongly overridden */
486 mutex_lock(&policy->lock); 482 mutex_lock(&policy->lock);
@@ -490,8 +486,6 @@ static ssize_t store_scaling_governor (struct cpufreq_policy * policy,
490 policy->user_policy.governor = policy->governor; 486 policy->user_policy.governor = policy->governor;
491 mutex_unlock(&policy->lock); 487 mutex_unlock(&policy->lock);
492 488
493 unlock_cpu_hotplug();
494
495 if (ret) 489 if (ret)
496 return ret; 490 return ret;
497 else 491 else
@@ -1278,7 +1272,6 @@ EXPORT_SYMBOL(cpufreq_unregister_notifier);
1278 *********************************************************************/ 1272 *********************************************************************/
1279 1273
1280 1274
1281/* Must be called with lock_cpu_hotplug held */
1282int __cpufreq_driver_target(struct cpufreq_policy *policy, 1275int __cpufreq_driver_target(struct cpufreq_policy *policy,
1283 unsigned int target_freq, 1276 unsigned int target_freq,
1284 unsigned int relation) 1277 unsigned int relation)
@@ -1304,13 +1297,11 @@ int cpufreq_driver_target(struct cpufreq_policy *policy,
1304 if (!policy) 1297 if (!policy)
1305 return -EINVAL; 1298 return -EINVAL;
1306 1299
1307 lock_cpu_hotplug();
1308 mutex_lock(&policy->lock); 1300 mutex_lock(&policy->lock);
1309 1301
1310 ret = __cpufreq_driver_target(policy, target_freq, relation); 1302 ret = __cpufreq_driver_target(policy, target_freq, relation);
1311 1303
1312 mutex_unlock(&policy->lock); 1304 mutex_unlock(&policy->lock);
1313 unlock_cpu_hotplug();
1314 1305
1315 cpufreq_cpu_put(policy); 1306 cpufreq_cpu_put(policy);
1316 return ret; 1307 return ret;
@@ -1338,7 +1329,6 @@ int cpufreq_driver_getavg(struct cpufreq_policy *policy)
1338EXPORT_SYMBOL_GPL(cpufreq_driver_getavg); 1329EXPORT_SYMBOL_GPL(cpufreq_driver_getavg);
1339 1330
1340/* 1331/*
1341 * Locking: Must be called with the lock_cpu_hotplug() lock held
1342 * when "event" is CPUFREQ_GOV_LIMITS 1332 * when "event" is CPUFREQ_GOV_LIMITS
1343 */ 1333 */
1344 1334
@@ -1433,7 +1423,6 @@ EXPORT_SYMBOL(cpufreq_get_policy);
1433/* 1423/*
1434 * data : current policy. 1424 * data : current policy.
1435 * policy : policy to be set. 1425 * policy : policy to be set.
1436 * Locking: Must be called with the lock_cpu_hotplug() lock held
1437 */ 1426 */
1438static int __cpufreq_set_policy(struct cpufreq_policy *data, 1427static int __cpufreq_set_policy(struct cpufreq_policy *data,
1439 struct cpufreq_policy *policy) 1428 struct cpufreq_policy *policy)
@@ -1539,8 +1528,6 @@ int cpufreq_set_policy(struct cpufreq_policy *policy)
1539 if (!data) 1528 if (!data)
1540 return -EINVAL; 1529 return -EINVAL;
1541 1530
1542 lock_cpu_hotplug();
1543
1544 /* lock this CPU */ 1531 /* lock this CPU */
1545 mutex_lock(&data->lock); 1532 mutex_lock(&data->lock);
1546 1533
@@ -1552,7 +1539,6 @@ int cpufreq_set_policy(struct cpufreq_policy *policy)
1552 1539
1553 mutex_unlock(&data->lock); 1540 mutex_unlock(&data->lock);
1554 1541
1555 unlock_cpu_hotplug();
1556 cpufreq_cpu_put(data); 1542 cpufreq_cpu_put(data);
1557 1543
1558 return ret; 1544 return ret;
@@ -1576,7 +1562,6 @@ int cpufreq_update_policy(unsigned int cpu)
1576 if (!data) 1562 if (!data)
1577 return -ENODEV; 1563 return -ENODEV;
1578 1564
1579 lock_cpu_hotplug();
1580 mutex_lock(&data->lock); 1565 mutex_lock(&data->lock);
1581 1566
1582 dprintk("updating policy for CPU %u\n", cpu); 1567 dprintk("updating policy for CPU %u\n", cpu);
@@ -1603,7 +1588,6 @@ int cpufreq_update_policy(unsigned int cpu)
1603 ret = __cpufreq_set_policy(data, &policy); 1588 ret = __cpufreq_set_policy(data, &policy);
1604 1589
1605 mutex_unlock(&data->lock); 1590 mutex_unlock(&data->lock);
1606 unlock_cpu_hotplug();
1607 cpufreq_cpu_put(data); 1591 cpufreq_cpu_put(data);
1608 return ret; 1592 return ret;
1609} 1593}