diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c index 06fcd8f9323c..6f11e029e8c5 100644 --- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | |||
@@ -150,9 +150,8 @@ struct drv_cmd { | |||
150 | u32 val; | 150 | u32 val; |
151 | }; | 151 | }; |
152 | 152 | ||
153 | static long do_drv_read(void *_cmd) | 153 | static void do_drv_read(struct drv_cmd *cmd) |
154 | { | 154 | { |
155 | struct drv_cmd *cmd = _cmd; | ||
156 | u32 h; | 155 | u32 h; |
157 | 156 | ||
158 | switch (cmd->type) { | 157 | switch (cmd->type) { |
@@ -167,12 +166,10 @@ static long do_drv_read(void *_cmd) | |||
167 | default: | 166 | default: |
168 | break; | 167 | break; |
169 | } | 168 | } |
170 | return 0; | ||
171 | } | 169 | } |
172 | 170 | ||
173 | static long do_drv_write(void *_cmd) | 171 | static void do_drv_write(struct drv_cmd *cmd) |
174 | { | 172 | { |
175 | struct drv_cmd *cmd = _cmd; | ||
176 | u32 lo, hi; | 173 | u32 lo, hi; |
177 | 174 | ||
178 | switch (cmd->type) { | 175 | switch (cmd->type) { |
@@ -189,23 +186,30 @@ static long do_drv_write(void *_cmd) | |||
189 | default: | 186 | default: |
190 | break; | 187 | break; |
191 | } | 188 | } |
192 | return 0; | ||
193 | } | 189 | } |
194 | 190 | ||
195 | static void drv_read(struct drv_cmd *cmd) | 191 | static void drv_read(struct drv_cmd *cmd) |
196 | { | 192 | { |
193 | cpumask_t saved_mask = current->cpus_allowed; | ||
197 | cmd->val = 0; | 194 | cmd->val = 0; |
198 | 195 | ||
199 | work_on_cpu(cpumask_any(cmd->mask), do_drv_read, cmd); | 196 | set_cpus_allowed_ptr(current, cmd->mask); |
197 | do_drv_read(cmd); | ||
198 | set_cpus_allowed_ptr(current, &saved_mask); | ||
200 | } | 199 | } |
201 | 200 | ||
202 | static void drv_write(struct drv_cmd *cmd) | 201 | static void drv_write(struct drv_cmd *cmd) |
203 | { | 202 | { |
203 | cpumask_t saved_mask = current->cpus_allowed; | ||
204 | unsigned int i; | 204 | unsigned int i; |
205 | 205 | ||
206 | for_each_cpu(i, cmd->mask) { | 206 | for_each_cpu(i, cmd->mask) { |
207 | work_on_cpu(i, do_drv_write, cmd); | 207 | set_cpus_allowed_ptr(current, cpumask_of(i)); |
208 | do_drv_write(cmd); | ||
208 | } | 209 | } |
210 | |||
211 | set_cpus_allowed_ptr(current, &saved_mask); | ||
212 | return; | ||
209 | } | 213 | } |
210 | 214 | ||
211 | static u32 get_cur_val(const struct cpumask *mask) | 215 | static u32 get_cur_val(const struct cpumask *mask) |
@@ -231,15 +235,10 @@ static u32 get_cur_val(const struct cpumask *mask) | |||
231 | return 0; | 235 | return 0; |
232 | } | 236 | } |
233 | 237 | ||
234 | if (unlikely(!alloc_cpumask_var(&cmd.mask, GFP_KERNEL))) | ||
235 | return 0; | ||
236 | |||
237 | cpumask_copy(cmd.mask, mask); | 238 | cpumask_copy(cmd.mask, mask); |
238 | 239 | ||
239 | drv_read(&cmd); | 240 | drv_read(&cmd); |
240 | 241 | ||
241 | free_cpumask_var(cmd.mask); | ||
242 | |||
243 | dprintk("get_cur_val = %u\n", cmd.val); | 242 | dprintk("get_cur_val = %u\n", cmd.val); |
244 | 243 | ||
245 | return cmd.val; | 244 | return cmd.val; |