aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/mm
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-02-24 00:40:15 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-03-20 04:14:01 -0500
commit77b838fa1ef0ab02f75afc09834c60d87b86772f (patch)
tree810bce2bf584b6259bd516daa0391cf1b3487ab4 /arch/sparc64/mm
parenta0663a79ad4faebe1db4a56e2e767b120b12333a (diff)
[SPARC64]: destroy_context() needs to disable interrupts.
get_new_mmu_context() can be invoked from interrupt context now for the new SMP version wrap handling. So disable interrupt while taking ctx_alloc_lock in destroy_context() so we don't deadlock. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/mm')
-rw-r--r--arch/sparc64/mm/tsb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/sparc64/mm/tsb.c b/arch/sparc64/mm/tsb.c
index 353cb060561b..534ac2819892 100644
--- a/arch/sparc64/mm/tsb.c
+++ b/arch/sparc64/mm/tsb.c
@@ -373,6 +373,7 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
373void destroy_context(struct mm_struct *mm) 373void destroy_context(struct mm_struct *mm)
374{ 374{
375 unsigned long size = mm->context.tsb_nentries * sizeof(struct tsb); 375 unsigned long size = mm->context.tsb_nentries * sizeof(struct tsb);
376 unsigned long flags;
376 377
377 free_pages((unsigned long) mm->context.tsb, get_order(size)); 378 free_pages((unsigned long) mm->context.tsb, get_order(size));
378 379
@@ -383,12 +384,12 @@ void destroy_context(struct mm_struct *mm)
383 mm->context.tsb = NULL; 384 mm->context.tsb = NULL;
384 mm->context.tsb_reg_val = 0UL; 385 mm->context.tsb_reg_val = 0UL;
385 386
386 spin_lock(&ctx_alloc_lock); 387 spin_lock_irqsave(&ctx_alloc_lock, flags);
387 388
388 if (CTX_VALID(mm->context)) { 389 if (CTX_VALID(mm->context)) {
389 unsigned long nr = CTX_NRBITS(mm->context); 390 unsigned long nr = CTX_NRBITS(mm->context);
390 mmu_context_bmap[nr>>6] &= ~(1UL << (nr & 63)); 391 mmu_context_bmap[nr>>6] &= ~(1UL << (nr & 63));
391 } 392 }
392 393
393 spin_unlock(&ctx_alloc_lock); 394 spin_unlock_irqrestore(&ctx_alloc_lock, flags);
394} 395}