aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/lockdep.h6
-rw-r--r--init/main.c1
-rw-r--r--kernel/irq/handle.c16
3 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 80ec7a4dbc98..316e0fb8d7b1 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -270,6 +270,12 @@ static inline int lockdep_internal(void)
270struct lock_class_key { }; 270struct lock_class_key { };
271#endif /* !LOCKDEP */ 271#endif /* !LOCKDEP */
272 272
273#if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_GENERIC_HARDIRQS)
274extern void early_init_irq_lock_class(void);
275#else
276# define early_init_irq_lock_class() do { } while (0)
277#endif
278
273#ifdef CONFIG_TRACE_IRQFLAGS 279#ifdef CONFIG_TRACE_IRQFLAGS
274extern void early_boot_irqs_off(void); 280extern void early_boot_irqs_off(void);
275extern void early_boot_irqs_on(void); 281extern void early_boot_irqs_on(void);
diff --git a/init/main.c b/init/main.c
index fc473d4b56fd..628b8e9e841a 100644
--- a/init/main.c
+++ b/init/main.c
@@ -466,6 +466,7 @@ asmlinkage void __init start_kernel(void)
466 466
467 local_irq_disable(); 467 local_irq_disable();
468 early_boot_irqs_off(); 468 early_boot_irqs_off();
469 early_init_irq_lock_class();
469 470
470/* 471/*
471 * Interrupts are still disabled. Do necessary setups, then 472 * Interrupts are still disabled. Do necessary setups, then
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
index aeb6e391276c..a7b497ee919e 100644
--- a/kernel/irq/handle.c
+++ b/kernel/irq/handle.c
@@ -249,3 +249,19 @@ out:
249 return 1; 249 return 1;
250} 250}
251 251
252#ifdef CONFIG_TRACE_IRQFLAGS
253
254/*
255 * lockdep: we want to handle all irq_desc locks as a single lock-class:
256 */
257static struct lock_class_key irq_desc_lock_class;
258
259void early_init_irq_lock_class(void)
260{
261 int i;
262
263 for (i = 0; i < NR_IRQS; i++)
264 lockdep_set_class(&irq_desc[i].lock, &irq_desc_lock_class);
265}
266
267#endif