diff options
| -rw-r--r-- | drivers/cpufreq/cpufreq_ondemand.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index 338f428a15b7..e741c339df76 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c | |||
| @@ -98,6 +98,9 @@ static unsigned int dbs_enable; /* number of CPUs using this policy */ | |||
| 98 | * (like __cpufreq_driver_target()) is being called with dbs_mutex taken, then | 98 | * (like __cpufreq_driver_target()) is being called with dbs_mutex taken, then |
| 99 | * cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock | 99 | * cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock |
| 100 | * is recursive for the same process. -Venki | 100 | * is recursive for the same process. -Venki |
| 101 | * DEADLOCK ALERT! (2) : do_dbs_timer() must not take the dbs_mutex, because it | ||
| 102 | * would deadlock with cancel_delayed_work_sync(), which is needed for proper | ||
| 103 | * raceless workqueue teardown. | ||
| 101 | */ | 104 | */ |
| 102 | static DEFINE_MUTEX(dbs_mutex); | 105 | static DEFINE_MUTEX(dbs_mutex); |
| 103 | 106 | ||
| @@ -562,7 +565,7 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) | |||
| 562 | static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info) | 565 | static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info) |
| 563 | { | 566 | { |
| 564 | dbs_info->enable = 0; | 567 | dbs_info->enable = 0; |
| 565 | cancel_delayed_work(&dbs_info->work); | 568 | cancel_delayed_work_sync(&dbs_info->work); |
| 566 | } | 569 | } |
| 567 | 570 | ||
| 568 | static int cpufreq_governor_dbs(struct cpufreq_policy *policy, | 571 | static int cpufreq_governor_dbs(struct cpufreq_policy *policy, |
