diff options
| -rw-r--r-- | drivers/cpufreq/cpufreq.c | 7 | ||||
| -rw-r--r-- | include/linux/cpufreq.h | 1 |
2 files changed, 1 insertions, 7 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index cf016584b4ac..2863214c5381 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
| @@ -1739,15 +1739,13 @@ static int __cpufreq_governor(struct cpufreq_policy *policy, | |||
| 1739 | policy->cpu, event); | 1739 | policy->cpu, event); |
| 1740 | 1740 | ||
| 1741 | mutex_lock(&cpufreq_governor_lock); | 1741 | mutex_lock(&cpufreq_governor_lock); |
| 1742 | if (policy->governor_busy | 1742 | if ((policy->governor_enabled && event == CPUFREQ_GOV_START) |
| 1743 | || (policy->governor_enabled && event == CPUFREQ_GOV_START) | ||
| 1744 | || (!policy->governor_enabled | 1743 | || (!policy->governor_enabled |
| 1745 | && (event == CPUFREQ_GOV_LIMITS || event == CPUFREQ_GOV_STOP))) { | 1744 | && (event == CPUFREQ_GOV_LIMITS || event == CPUFREQ_GOV_STOP))) { |
| 1746 | mutex_unlock(&cpufreq_governor_lock); | 1745 | mutex_unlock(&cpufreq_governor_lock); |
| 1747 | return -EBUSY; | 1746 | return -EBUSY; |
| 1748 | } | 1747 | } |
| 1749 | 1748 | ||
| 1750 | policy->governor_busy = true; | ||
| 1751 | if (event == CPUFREQ_GOV_STOP) | 1749 | if (event == CPUFREQ_GOV_STOP) |
| 1752 | policy->governor_enabled = false; | 1750 | policy->governor_enabled = false; |
| 1753 | else if (event == CPUFREQ_GOV_START) | 1751 | else if (event == CPUFREQ_GOV_START) |
| @@ -1776,9 +1774,6 @@ static int __cpufreq_governor(struct cpufreq_policy *policy, | |||
| 1776 | ((event == CPUFREQ_GOV_POLICY_EXIT) && !ret)) | 1774 | ((event == CPUFREQ_GOV_POLICY_EXIT) && !ret)) |
| 1777 | module_put(policy->governor->owner); | 1775 | module_put(policy->governor->owner); |
| 1778 | 1776 | ||
| 1779 | mutex_lock(&cpufreq_governor_lock); | ||
| 1780 | policy->governor_busy = false; | ||
| 1781 | mutex_unlock(&cpufreq_governor_lock); | ||
| 1782 | return ret; | 1777 | return ret; |
| 1783 | } | 1778 | } |
| 1784 | 1779 | ||
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index cca885dac1d3..d568f3975eeb 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
| @@ -76,7 +76,6 @@ struct cpufreq_policy { | |||
| 76 | struct cpufreq_governor *governor; /* see below */ | 76 | struct cpufreq_governor *governor; /* see below */ |
| 77 | void *governor_data; | 77 | void *governor_data; |
| 78 | bool governor_enabled; /* governor start/stop flag */ | 78 | bool governor_enabled; /* governor start/stop flag */ |
| 79 | bool governor_busy; | ||
| 80 | 79 | ||
| 81 | struct work_struct update; /* if update_policy() needs to be | 80 | struct work_struct update; /* if update_policy() needs to be |
| 82 | * called, but you're in IRQ context */ | 81 | * called, but you're in IRQ context */ |
