diff options
-rw-r--r-- | arch/i386/kernel/cpu/mtrr/main.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/i386/kernel/cpu/mtrr/main.c b/arch/i386/kernel/cpu/mtrr/main.c index 1e9db198c440..1a577768d4da 100644 --- a/arch/i386/kernel/cpu/mtrr/main.c +++ b/arch/i386/kernel/cpu/mtrr/main.c | |||
@@ -49,7 +49,7 @@ | |||
49 | u32 num_var_ranges = 0; | 49 | u32 num_var_ranges = 0; |
50 | 50 | ||
51 | unsigned int *usage_table; | 51 | unsigned int *usage_table; |
52 | static DECLARE_MUTEX(main_lock); | 52 | static DECLARE_MUTEX(mtrr_sem); |
53 | 53 | ||
54 | u32 size_or_mask, size_and_mask; | 54 | u32 size_or_mask, size_and_mask; |
55 | 55 | ||
@@ -335,7 +335,7 @@ int mtrr_add_page(unsigned long base, unsigned long size, | |||
335 | /* No CPU hotplug when we change MTRR entries */ | 335 | /* No CPU hotplug when we change MTRR entries */ |
336 | lock_cpu_hotplug(); | 336 | lock_cpu_hotplug(); |
337 | /* Search for existing MTRR */ | 337 | /* Search for existing MTRR */ |
338 | down(&main_lock); | 338 | down(&mtrr_sem); |
339 | for (i = 0; i < num_var_ranges; ++i) { | 339 | for (i = 0; i < num_var_ranges; ++i) { |
340 | mtrr_if->get(i, &lbase, &lsize, <ype); | 340 | mtrr_if->get(i, &lbase, &lsize, <ype); |
341 | if (base >= lbase + lsize) | 341 | if (base >= lbase + lsize) |
@@ -373,7 +373,7 @@ int mtrr_add_page(unsigned long base, unsigned long size, | |||
373 | printk(KERN_INFO "mtrr: no more MTRRs available\n"); | 373 | printk(KERN_INFO "mtrr: no more MTRRs available\n"); |
374 | error = i; | 374 | error = i; |
375 | out: | 375 | out: |
376 | up(&main_lock); | 376 | up(&mtrr_sem); |
377 | unlock_cpu_hotplug(); | 377 | unlock_cpu_hotplug(); |
378 | return error; | 378 | return error; |
379 | } | 379 | } |
@@ -466,7 +466,7 @@ int mtrr_del_page(int reg, unsigned long base, unsigned long size) | |||
466 | max = num_var_ranges; | 466 | max = num_var_ranges; |
467 | /* No CPU hotplug when we change MTRR entries */ | 467 | /* No CPU hotplug when we change MTRR entries */ |
468 | lock_cpu_hotplug(); | 468 | lock_cpu_hotplug(); |
469 | down(&main_lock); | 469 | down(&mtrr_sem); |
470 | if (reg < 0) { | 470 | if (reg < 0) { |
471 | /* Search for existing MTRR */ | 471 | /* Search for existing MTRR */ |
472 | for (i = 0; i < max; ++i) { | 472 | for (i = 0; i < max; ++i) { |
@@ -505,7 +505,7 @@ int mtrr_del_page(int reg, unsigned long base, unsigned long size) | |||
505 | set_mtrr(reg, 0, 0, 0); | 505 | set_mtrr(reg, 0, 0, 0); |
506 | error = reg; | 506 | error = reg; |
507 | out: | 507 | out: |
508 | up(&main_lock); | 508 | up(&mtrr_sem); |
509 | unlock_cpu_hotplug(); | 509 | unlock_cpu_hotplug(); |
510 | return error; | 510 | return error; |
511 | } | 511 | } |
@@ -688,7 +688,7 @@ void mtrr_ap_init(void) | |||
688 | if (!mtrr_if || !use_intel()) | 688 | if (!mtrr_if || !use_intel()) |
689 | return; | 689 | return; |
690 | /* | 690 | /* |
691 | * Ideally we should hold main_lock here to avoid mtrr entries changed, | 691 | * Ideally we should hold mtrr_sem here to avoid mtrr entries changed, |
692 | * but this routine will be called in cpu boot time, holding the lock | 692 | * but this routine will be called in cpu boot time, holding the lock |
693 | * breaks it. This routine is called in two cases: 1.very earily time | 693 | * breaks it. This routine is called in two cases: 1.very earily time |
694 | * of software resume, when there absolutely isn't mtrr entry changes; | 694 | * of software resume, when there absolutely isn't mtrr entry changes; |