diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/cpufreq/cpufreq_userspace.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/cpufreq/cpufreq_userspace.c b/drivers/cpufreq/cpufreq_userspace.c index 1442bbada053..66d2d1d6c80f 100644 --- a/drivers/cpufreq/cpufreq_userspace.c +++ b/drivers/cpufreq/cpufreq_userspace.c | |||
@@ -24,9 +24,6 @@ | |||
24 | #include <linux/sysfs.h> | 24 | #include <linux/sysfs.h> |
25 | #include <linux/mutex.h> | 25 | #include <linux/mutex.h> |
26 | 26 | ||
27 | #include <asm/uaccess.h> | ||
28 | |||
29 | |||
30 | /** | 27 | /** |
31 | * A few values needed by the userspace governor | 28 | * A few values needed by the userspace governor |
32 | */ | 29 | */ |
@@ -37,7 +34,7 @@ static DEFINE_PER_CPU(unsigned int, cpu_set_freq); /* CPU freq desired by | |||
37 | userspace */ | 34 | userspace */ |
38 | static DEFINE_PER_CPU(unsigned int, cpu_is_managed); | 35 | static DEFINE_PER_CPU(unsigned int, cpu_is_managed); |
39 | 36 | ||
40 | static DEFINE_MUTEX (userspace_mutex); | 37 | static DEFINE_MUTEX(userspace_mutex); |
41 | static int cpus_using_userspace_governor; | 38 | static int cpus_using_userspace_governor; |
42 | 39 | ||
43 | #define dprintk(msg...) \ | 40 | #define dprintk(msg...) \ |
@@ -46,9 +43,9 @@ static int cpus_using_userspace_governor; | |||
46 | /* keep track of frequency transitions */ | 43 | /* keep track of frequency transitions */ |
47 | static int | 44 | static int |
48 | userspace_cpufreq_notifier(struct notifier_block *nb, unsigned long val, | 45 | userspace_cpufreq_notifier(struct notifier_block *nb, unsigned long val, |
49 | void *data) | 46 | void *data) |
50 | { | 47 | { |
51 | struct cpufreq_freqs *freq = data; | 48 | struct cpufreq_freqs *freq = data; |
52 | 49 | ||
53 | if (!per_cpu(cpu_is_managed, freq->cpu)) | 50 | if (!per_cpu(cpu_is_managed, freq->cpu)) |
54 | return 0; | 51 | return 0; |
@@ -57,11 +54,11 @@ userspace_cpufreq_notifier(struct notifier_block *nb, unsigned long val, | |||
57 | freq->cpu, freq->new); | 54 | freq->cpu, freq->new); |
58 | per_cpu(cpu_cur_freq, freq->cpu) = freq->new; | 55 | per_cpu(cpu_cur_freq, freq->cpu) = freq->new; |
59 | 56 | ||
60 | return 0; | 57 | return 0; |
61 | } | 58 | } |
62 | 59 | ||
63 | static struct notifier_block userspace_cpufreq_notifier_block = { | 60 | static struct notifier_block userspace_cpufreq_notifier_block = { |
64 | .notifier_call = userspace_cpufreq_notifier | 61 | .notifier_call = userspace_cpufreq_notifier |
65 | }; | 62 | }; |
66 | 63 | ||
67 | 64 | ||
@@ -93,8 +90,11 @@ static int cpufreq_set(struct cpufreq_policy *policy, unsigned int freq) | |||
93 | * We're safe from concurrent calls to ->target() here | 90 | * We're safe from concurrent calls to ->target() here |
94 | * as we hold the userspace_mutex lock. If we were calling | 91 | * as we hold the userspace_mutex lock. If we were calling |
95 | * cpufreq_driver_target, a deadlock situation might occur: | 92 | * cpufreq_driver_target, a deadlock situation might occur: |
96 | * A: cpufreq_set (lock userspace_mutex) -> cpufreq_driver_target(lock policy->lock) | 93 | * A: cpufreq_set (lock userspace_mutex) -> |
97 | * B: cpufreq_set_policy(lock policy->lock) -> __cpufreq_governor -> cpufreq_governor_userspace (lock userspace_mutex) | 94 | * cpufreq_driver_target(lock policy->lock) |
95 | * B: cpufreq_set_policy(lock policy->lock) -> | ||
96 | * __cpufreq_governor -> | ||
97 | * cpufreq_governor_userspace (lock userspace_mutex) | ||
98 | */ | 98 | */ |
99 | ret = __cpufreq_driver_target(policy, freq, CPUFREQ_RELATION_L); | 99 | ret = __cpufreq_driver_target(policy, freq, CPUFREQ_RELATION_L); |
100 | 100 | ||
@@ -210,9 +210,10 @@ static void __exit cpufreq_gov_userspace_exit(void) | |||
210 | } | 210 | } |
211 | 211 | ||
212 | 212 | ||
213 | MODULE_AUTHOR ("Dominik Brodowski <linux@brodo.de>, Russell King <rmk@arm.linux.org.uk>"); | 213 | MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>, " |
214 | MODULE_DESCRIPTION ("CPUfreq policy governor 'userspace'"); | 214 | "Russell King <rmk@arm.linux.org.uk>"); |
215 | MODULE_LICENSE ("GPL"); | 215 | MODULE_DESCRIPTION("CPUfreq policy governor 'userspace'"); |
216 | MODULE_LICENSE("GPL"); | ||
216 | 217 | ||
217 | #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE | 218 | #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE |
218 | fs_initcall(cpufreq_gov_userspace_init); | 219 | fs_initcall(cpufreq_gov_userspace_init); |