diff options
author | Dmitry Adamushko <dmitry.adamushko@gmail.com> | 2008-10-02 09:56:19 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-02 11:52:33 -0400 |
commit | fd1452ebf257317f24e0e285a17a2ec2ce3e6df7 (patch) | |
tree | 315d1024bb974e8c20f2d451aefa23562e6f2be7 /arch | |
parent | 82b078659ed04e1ecdebf8326e189cf76ed361af (diff) |
x86/microcode: fix sleeping function called from invalid context at kernel/mutex.c
Fix the following "sleeping function called from invalid context" bug:
...
__might_sleep
mutex_lock_nested
microcode_update_cpu
mc_sysdev_resume
__sysdev_resume
sysdev_resume
device_power_up
...
Signed-off-by: Dmitry Adamushko <dmitry.adamushko@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/microcode_core.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c index 8db2eb55e9e2..936d8d55f230 100644 --- a/arch/x86/kernel/microcode_core.c +++ b/arch/x86/kernel/microcode_core.c | |||
@@ -324,10 +324,6 @@ void microcode_update_cpu(int cpu) | |||
324 | struct ucode_cpu_info *uci = ucode_cpu_info + cpu; | 324 | struct ucode_cpu_info *uci = ucode_cpu_info + cpu; |
325 | int err = 0; | 325 | int err = 0; |
326 | 326 | ||
327 | /* We should bind the task to the CPU */ | ||
328 | BUG_ON(raw_smp_processor_id() != cpu); | ||
329 | |||
330 | mutex_lock(µcode_mutex); | ||
331 | /* | 327 | /* |
332 | * Check if the system resume is in progress (uci->valid != NULL), | 328 | * Check if the system resume is in progress (uci->valid != NULL), |
333 | * otherwise just request a firmware: | 329 | * otherwise just request a firmware: |
@@ -340,11 +336,8 @@ void microcode_update_cpu(int cpu) | |||
340 | err = microcode_ops->request_microcode_fw(cpu, | 336 | err = microcode_ops->request_microcode_fw(cpu, |
341 | µcode_pdev->dev); | 337 | µcode_pdev->dev); |
342 | } | 338 | } |
343 | |||
344 | if (!err) | 339 | if (!err) |
345 | microcode_ops->apply_microcode(cpu); | 340 | microcode_ops->apply_microcode(cpu); |
346 | |||
347 | mutex_unlock(µcode_mutex); | ||
348 | } | 341 | } |
349 | 342 | ||
350 | static void microcode_init_cpu(int cpu) | 343 | static void microcode_init_cpu(int cpu) |
@@ -352,7 +345,13 @@ static void microcode_init_cpu(int cpu) | |||
352 | cpumask_t old = current->cpus_allowed; | 345 | cpumask_t old = current->cpus_allowed; |
353 | 346 | ||
354 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); | 347 | set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu)); |
348 | /* We should bind the task to the CPU */ | ||
349 | BUG_ON(raw_smp_processor_id() != cpu); | ||
350 | |||
351 | mutex_lock(µcode_mutex); | ||
355 | microcode_update_cpu(cpu); | 352 | microcode_update_cpu(cpu); |
353 | mutex_unlock(µcode_mutex); | ||
354 | |||
356 | set_cpus_allowed_ptr(current, &old); | 355 | set_cpus_allowed_ptr(current, &old); |
357 | } | 356 | } |
358 | 357 | ||