diff options
Diffstat (limited to 'arch/sparc64/mm/init.c')
-rw-r--r-- | arch/sparc64/mm/init.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index 9bbd0bf64af0..a63939347b3d 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -639,9 +639,10 @@ void get_new_mmu_context(struct mm_struct *mm) | |||
639 | { | 639 | { |
640 | unsigned long ctx, new_ctx; | 640 | unsigned long ctx, new_ctx; |
641 | unsigned long orig_pgsz_bits; | 641 | unsigned long orig_pgsz_bits; |
642 | unsigned long flags; | ||
642 | int new_version; | 643 | int new_version; |
643 | 644 | ||
644 | spin_lock(&ctx_alloc_lock); | 645 | spin_lock_irqsave(&ctx_alloc_lock, flags); |
645 | orig_pgsz_bits = (mm->context.sparc64_ctx_val & CTX_PGSZ_MASK); | 646 | orig_pgsz_bits = (mm->context.sparc64_ctx_val & CTX_PGSZ_MASK); |
646 | ctx = (tlb_context_cache + 1) & CTX_NR_MASK; | 647 | ctx = (tlb_context_cache + 1) & CTX_NR_MASK; |
647 | new_ctx = find_next_zero_bit(mmu_context_bmap, 1 << CTX_NR_BITS, ctx); | 648 | new_ctx = find_next_zero_bit(mmu_context_bmap, 1 << CTX_NR_BITS, ctx); |
@@ -677,7 +678,7 @@ void get_new_mmu_context(struct mm_struct *mm) | |||
677 | out: | 678 | out: |
678 | tlb_context_cache = new_ctx; | 679 | tlb_context_cache = new_ctx; |
679 | mm->context.sparc64_ctx_val = new_ctx | orig_pgsz_bits; | 680 | mm->context.sparc64_ctx_val = new_ctx | orig_pgsz_bits; |
680 | spin_unlock(&ctx_alloc_lock); | 681 | spin_unlock_irqrestore(&ctx_alloc_lock, flags); |
681 | 682 | ||
682 | if (unlikely(new_version)) | 683 | if (unlikely(new_version)) |
683 | smp_new_mmu_context_version(); | 684 | smp_new_mmu_context_version(); |