]> err.no Git - linux-2.6/commitdiff
[PATCH] ARM: Allow register_undef_hook to be called with IRQs off
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Sat, 16 Jul 2005 15:43:33 +0000 (16:43 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 16 Jul 2005 15:43:33 +0000 (16:43 +0100)
Preserve the interrupt status across a call to register_undef_hook.
This allows it to be called while interrupts are disabled.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/kernel/traps.c

index df2cb06ce424f7fd95e3cf3fa4a1cd9c1d398896..d571c37ac30c1f0b16fd8e81f5542aa35995d4d4 100644 (file)
@@ -248,16 +248,20 @@ static DEFINE_SPINLOCK(undef_lock);
 
 void register_undef_hook(struct undef_hook *hook)
 {
-       spin_lock_irq(&undef_lock);
+       unsigned long flags;
+
+       spin_lock_irqsave(&undef_lock, flags);
        list_add(&hook->node, &undef_hook);
-       spin_unlock_irq(&undef_lock);
+       spin_unlock_irqrestore(&undef_lock, flags);
 }
 
 void unregister_undef_hook(struct undef_hook *hook)
 {
-       spin_lock_irq(&undef_lock);
+       unsigned long flags;
+
+       spin_lock_irqsave(&undef_lock, flags);
        list_del(&hook->node);
-       spin_unlock_irq(&undef_lock);
+       spin_unlock_irqrestore(&undef_lock, flags);
 }
 
 asmlinkage void do_undefinstr(struct pt_regs *regs)