浏览代码

cpumask fallout: Initialize irq_default_affinity earlier

Move the initialization of irq_default_affinity to early_irq_init as
core_initcall is too late.

irq_default_affinity can be used in init_IRQ and potentially timer and
SMP init as well.  All of these happen before core_initcall.  Moving
the initialization to early_irq_init ensures that it is initialized
before it is used.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Acked-by: Mike Travis <travis@sgi.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
David Daney 16 年之前
父节点
当前提交
97179fd46d
共有 2 个文件被更改,包括 16 次插入8 次删除
  1. 16 0
      kernel/irq/handle.c
  2. 0 8
      kernel/irq/manage.c

+ 16 - 0
kernel/irq/handle.c

@@ -39,6 +39,18 @@ void handle_bad_irq(unsigned int irq, struct irq_desc *desc)
 	ack_bad_irq(irq);
 	ack_bad_irq(irq);
 }
 }
 
 
+#if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_HARDIRQS)
+static void __init init_irq_default_affinity(void)
+{
+	alloc_bootmem_cpumask_var(&irq_default_affinity);
+	cpumask_setall(irq_default_affinity);
+}
+#else
+static void __init init_irq_default_affinity(void)
+{
+}
+#endif
+
 /*
 /*
  * Linux has a controller-independent interrupt architecture.
  * Linux has a controller-independent interrupt architecture.
  * Every controller has a 'controller-template', that is used
  * Every controller has a 'controller-template', that is used
@@ -134,6 +146,8 @@ int __init early_irq_init(void)
 	int legacy_count;
 	int legacy_count;
 	int i;
 	int i;
 
 
+	init_irq_default_affinity();
+
 	desc = irq_desc_legacy;
 	desc = irq_desc_legacy;
 	legacy_count = ARRAY_SIZE(irq_desc_legacy);
 	legacy_count = ARRAY_SIZE(irq_desc_legacy);
 
 
@@ -219,6 +233,8 @@ int __init early_irq_init(void)
 	int count;
 	int count;
 	int i;
 	int i;
 
 
+	init_irq_default_affinity();
+
 	desc = irq_desc;
 	desc = irq_desc;
 	count = ARRAY_SIZE(irq_desc);
 	count = ARRAY_SIZE(irq_desc);
 
 

+ 0 - 8
kernel/irq/manage.c

@@ -18,14 +18,6 @@
 #if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_HARDIRQS)
 #if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_HARDIRQS)
 cpumask_var_t irq_default_affinity;
 cpumask_var_t irq_default_affinity;
 
 
-static int init_irq_default_affinity(void)
-{
-	alloc_cpumask_var(&irq_default_affinity, GFP_KERNEL);
-	cpumask_setall(irq_default_affinity);
-	return 0;
-}
-core_initcall(init_irq_default_affinity);
-
 /**
 /**
  *	synchronize_irq - wait for pending IRQ handlers (on other CPUs)
  *	synchronize_irq - wait for pending IRQ handlers (on other CPUs)
  *	@irq: interrupt number to wait for
  *	@irq: interrupt number to wait for