提交 243c7621 编写于 作者: I Ingo Molnar 提交者: Linus Torvalds

[PATCH] lockdep: annotate genirq

Teach special (recursive) locking code to the lock validator.  Has no effect
on non-lockdep kernels.
Signed-off-by: NIngo Molnar <mingo@elte.hu>
Signed-off-by: NArjan van de Ven <arjan@linux.intel.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 8b8f319f
...@@ -270,6 +270,12 @@ static inline int lockdep_internal(void) ...@@ -270,6 +270,12 @@ static inline int lockdep_internal(void)
struct lock_class_key { }; struct lock_class_key { };
#endif /* !LOCKDEP */ #endif /* !LOCKDEP */
#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_GENERIC_HARDIRQS)
extern void early_init_irq_lock_class(void);
#else
# define early_init_irq_lock_class() do { } while (0)
#endif
#ifdef CONFIG_TRACE_IRQFLAGS #ifdef CONFIG_TRACE_IRQFLAGS
extern void early_boot_irqs_off(void); extern void early_boot_irqs_off(void);
extern void early_boot_irqs_on(void); extern void early_boot_irqs_on(void);
......
...@@ -466,6 +466,7 @@ asmlinkage void __init start_kernel(void) ...@@ -466,6 +466,7 @@ asmlinkage void __init start_kernel(void)
local_irq_disable(); local_irq_disable();
early_boot_irqs_off(); early_boot_irqs_off();
early_init_irq_lock_class();
/* /*
* Interrupts are still disabled. Do necessary setups, then * Interrupts are still disabled. Do necessary setups, then
......
...@@ -249,3 +249,19 @@ fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs) ...@@ -249,3 +249,19 @@ fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs)
return 1; return 1;
} }
#ifdef CONFIG_TRACE_IRQFLAGS
/*
* lockdep: we want to handle all irq_desc locks as a single lock-class:
*/
static struct lock_class_key irq_desc_lock_class;
void early_init_irq_lock_class(void)
{
int i;
for (i = 0; i < NR_IRQS; i++)
lockdep_set_class(&irq_desc[i].lock, &irq_desc_lock_class);
}
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册