mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-14 05:12:17 +00:00
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>
This commit is contained in:
parent
b9db42730a
commit
f62b93740c
@ -300,13 +300,6 @@ static void gov_cancel_work(struct cpufreq_policy *policy)
|
|||||||
{
|
{
|
||||||
struct policy_dbs_info *policy_dbs = policy->governor_data;
|
struct policy_dbs_info *policy_dbs = policy->governor_data;
|
||||||
|
|
||||||
/* Tell dbs_update_util_handler() to skip queuing up work items. */
|
|
||||||
atomic_inc(&policy_dbs->work_count);
|
|
||||||
/*
|
|
||||||
* If dbs_update_util_handler() is already running, it may not notice
|
|
||||||
* the incremented work_count, so wait for it to complete to prevent its
|
|
||||||
* work item from being queued up after the cancel_work_sync() below.
|
|
||||||
*/
|
|
||||||
gov_clear_update_util(policy_dbs->policy);
|
gov_clear_update_util(policy_dbs->policy);
|
||||||
irq_work_sync(&policy_dbs->irq_work);
|
irq_work_sync(&policy_dbs->irq_work);
|
||||||
cancel_work_sync(&policy_dbs->work);
|
cancel_work_sync(&policy_dbs->work);
|
||||||
@ -360,7 +353,6 @@ static void dbs_update_util_handler(struct update_util_data *data, u64 time,
|
|||||||
* The work may not be allowed to be queued up right now.
|
* The work may not be allowed to be queued up right now.
|
||||||
* Possible reasons:
|
* Possible reasons:
|
||||||
* - Work has already been queued up or is in progress.
|
* - Work has already been queued up or is in progress.
|
||||||
* - The governor is being stopped.
|
|
||||||
* - It is too early (too little time from the previous sample).
|
* - It is too early (too little time from the previous sample).
|
||||||
*/
|
*/
|
||||||
if (atomic_inc_return(&policy_dbs->work_count) == 1) {
|
if (atomic_inc_return(&policy_dbs->work_count) == 1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user