locking, ARM: Annotate low level hw locks as raw
Annotate the low level hardware locks which must not be preempted. In mainline this change documents the low level nature of the lock - otherwise there's no functional difference. Lockdep and Sparse checking will work as usual. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:

committed by
Ingo Molnar

parent
a1741e7fcb
commit
bd31b85960
@@ -255,7 +255,7 @@ static int __die(const char *str, int err, struct thread_info *thread, struct pt
|
||||
return ret;
|
||||
}
|
||||
|
||||
static DEFINE_SPINLOCK(die_lock);
|
||||
static DEFINE_RAW_SPINLOCK(die_lock);
|
||||
|
||||
/*
|
||||
* This function is protected against re-entrancy.
|
||||
@@ -267,7 +267,7 @@ void die(const char *str, struct pt_regs *regs, int err)
|
||||
|
||||
oops_enter();
|
||||
|
||||
spin_lock_irq(&die_lock);
|
||||
raw_spin_lock_irq(&die_lock);
|
||||
console_verbose();
|
||||
bust_spinlocks(1);
|
||||
ret = __die(str, err, thread, regs);
|
||||
@@ -277,7 +277,7 @@ void die(const char *str, struct pt_regs *regs, int err)
|
||||
|
||||
bust_spinlocks(0);
|
||||
add_taint(TAINT_DIE);
|
||||
spin_unlock_irq(&die_lock);
|
||||
raw_spin_unlock_irq(&die_lock);
|
||||
oops_exit();
|
||||
|
||||
if (in_interrupt())
|
||||
@@ -302,24 +302,24 @@ void arm_notify_die(const char *str, struct pt_regs *regs,
|
||||
}
|
||||
|
||||
static LIST_HEAD(undef_hook);
|
||||
static DEFINE_SPINLOCK(undef_lock);
|
||||
static DEFINE_RAW_SPINLOCK(undef_lock);
|
||||
|
||||
void register_undef_hook(struct undef_hook *hook)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&undef_lock, flags);
|
||||
raw_spin_lock_irqsave(&undef_lock, flags);
|
||||
list_add(&hook->node, &undef_hook);
|
||||
spin_unlock_irqrestore(&undef_lock, flags);
|
||||
raw_spin_unlock_irqrestore(&undef_lock, flags);
|
||||
}
|
||||
|
||||
void unregister_undef_hook(struct undef_hook *hook)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&undef_lock, flags);
|
||||
raw_spin_lock_irqsave(&undef_lock, flags);
|
||||
list_del(&hook->node);
|
||||
spin_unlock_irqrestore(&undef_lock, flags);
|
||||
raw_spin_unlock_irqrestore(&undef_lock, flags);
|
||||
}
|
||||
|
||||
static int call_undef_hook(struct pt_regs *regs, unsigned int instr)
|
||||
@@ -328,12 +328,12 @@ static int call_undef_hook(struct pt_regs *regs, unsigned int instr)
|
||||
unsigned long flags;
|
||||
int (*fn)(struct pt_regs *regs, unsigned int instr) = NULL;
|
||||
|
||||
spin_lock_irqsave(&undef_lock, flags);
|
||||
raw_spin_lock_irqsave(&undef_lock, flags);
|
||||
list_for_each_entry(hook, &undef_hook, node)
|
||||
if ((instr & hook->instr_mask) == hook->instr_val &&
|
||||
(regs->ARM_cpsr & hook->cpsr_mask) == hook->cpsr_val)
|
||||
fn = hook->fn;
|
||||
spin_unlock_irqrestore(&undef_lock, flags);
|
||||
raw_spin_unlock_irqrestore(&undef_lock, flags);
|
||||
|
||||
return fn ? fn(regs, instr) : 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user