Skip to content

Commit

Permalink
sh: Need IRQs enabled for init_fpu().
Browse files Browse the repository at this point in the history
This tosses in a local_irq_enable()/disable() pair around the init_fpu()
callsite in the FPU state restore exception handler. Fixes up a slab BUG
triggered by making a slab cache allocation that can sleep whilst
irqs_disabled(). This follows the behaviour undertaken by the x86
implementation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Jan 18, 2010
1 parent 3d46767 commit 4291b73
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/sh/kernel/cpu/fpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ void fpu_state_restore(struct pt_regs *regs)
}

if (!tsk_used_math(tsk)) {
local_irq_enable();
/*
* does a slab alloc which can sleep
*/
Expand All @@ -66,6 +67,7 @@ void fpu_state_restore(struct pt_regs *regs)
do_group_exit(SIGKILL);
return;
}
local_irq_disable();
}

grab_fpu(regs);
Expand Down

0 comments on commit 4291b73

Please sign in to comment.