From: Russell King Date: Sat, 16 Jul 2005 15:43:33 +0000 (+0100) Subject: [PATCH] ARM: Allow register_undef_hook to be called with IRQs off X-Git-Tag: v2.6.13-rc4~88^2~2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=109d89ca0ee76138e04b41726b7f719c7df65e88;p=linux-2.6 [PATCH] ARM: Allow register_undef_hook to be called with IRQs off 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 --- diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index df2cb06ce4..d571c37ac3 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c @@ -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)