aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-02-14 20:12:56 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-03-09 08:41:02 -0500
commitf62b93740c30d0a3f50258d45415f00b763dd70a (patch)
treee0bd59cb038df6acbaea1df06b50f6a1c221afd6
parentb9db42730aeb23f91d7585786de25a260ab04098 (diff)
cpufreq: governor: Simplify gov_cancel_work() slightly
The atomic work counter incrementation in gov_cancel_work() is not necessary any more, because work items won't be queued up after gov_clear_update_util() anyway, so drop it along with the comment about how it may be missed by the gov_clear_update_util(). Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
-rw-r--r--drivers/cpufreq/cpufreq_governor.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
index 580b692d6df4..c78af11a51f0 100644
--- a/drivers/cpufreq/cpufreq_governor.c
+++ b/drivers/cpufreq/cpufreq_governor.c
@@ -300,13 +300,6 @@ static void gov_cancel_work(struct cpufreq_policy *policy)
300{ 300{
301 struct policy_dbs_info *policy_dbs = policy->governor_data; 301 struct policy_dbs_info *policy_dbs = policy->governor_data;
302 302
303 /* Tell dbs_update_util_handler() to skip queuing up work items. */
304 atomic_inc(&policy_dbs->work_count);
305 /*
306 * If dbs_update_util_handler() is already running, it may not notice
307 * the incremented work_count, so wait for it to complete to prevent its
308 * work item from being queued up after the cancel_work_sync() below.
309 */
310 gov_clear_update_util(policy_dbs->policy); 303 gov_clear_update_util(policy_dbs->policy);
311 irq_work_sync(&policy_dbs->irq_work); 304 irq_work_sync(&policy_dbs->irq_work);
312 cancel_work_sync(&policy_dbs->work); 305 cancel_work_sync(&policy_dbs->work);
@@ -360,7 +353,6 @@ static void dbs_update_util_handler(struct update_util_data *data, u64 time,
360 * The work may not be allowed to be queued up right now. 353 * The work may not be allowed to be queued up right now.
361 * Possible reasons: 354 * Possible reasons:
362 * - Work has already been queued up or is in progress. 355 * - Work has already been queued up or is in progress.
363 * - The governor is being stopped.
364 * - It is too early (too little time from the previous sample). 356 * - It is too early (too little time from the previous sample).
365 */ 357 */
366 if (atomic_inc_return(&policy_dbs->work_count) == 1) { 358 if (atomic_inc_return(&policy_dbs->work_count) == 1) {