public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5/9] x86/ioapic: improve handling of i8259a irq init
@ 2010-02-13  1:40 Pan, Jacob jun
  2010-02-20  1:28 ` [tip:x86/mrst] x86, ioapic: Improve handling of i8259A " tip-bot for Alek Du
  0 siblings, 1 reply; 18+ messages in thread
From: Pan, Jacob jun @ 2010-02-13  1:40 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org
  Cc: Ingo Molnar, Thomas Gleixner, Arjan van de Ven, Barnes, Jesse,
	Du, Alek, Tang, Feng, H. Peter Anvin

>From ab3ae105e88342a26e4a1d46d6dcdff2fb7970fe Mon Sep 17 00:00:00 2001
From: Alek Du <alek.du@intel.com>
Date: Mon, 7 Sep 2009 16:25:45 +0800
Subject: [PATCH 5/9] x86/ioapic: improve handling of i8259a irq init

Since we already track the number of legacy vectors by nr_legacy_irqs, we
can avoid use static vector allocations -- we can use dynamic one.

Signed-off-by: Alek Du <alek.du@intel.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@intel.com>
---
 arch/x86/kernel/apic/io_apic.c |   23 ++++-------------------
 1 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 53243ca..75265ab 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -140,27 +140,10 @@ static struct irq_pin_list *get_one_free_irq_2_pin(int node)
 
 /* irq_cfg is indexed by the sum of all RTEs in all I/O APICs. */
 #ifdef CONFIG_SPARSE_IRQ
-static struct irq_cfg irq_cfgx[] = {
+static struct irq_cfg irq_cfgx[NR_IRQS_LEGACY];
 #else
-static struct irq_cfg irq_cfgx[NR_IRQS] = {
+static struct irq_cfg irq_cfgx[NR_IRQS];
 #endif
-	[0]  = { .vector = IRQ0_VECTOR,  },
-	[1]  = { .vector = IRQ1_VECTOR,  },
-	[2]  = { .vector = IRQ2_VECTOR,  },
-	[3]  = { .vector = IRQ3_VECTOR,  },
-	[4]  = { .vector = IRQ4_VECTOR,  },
-	[5]  = { .vector = IRQ5_VECTOR,  },
-	[6]  = { .vector = IRQ6_VECTOR,  },
-	[7]  = { .vector = IRQ7_VECTOR,  },
-	[8]  = { .vector = IRQ8_VECTOR,  },
-	[9]  = { .vector = IRQ9_VECTOR,  },
-	[10] = { .vector = IRQ10_VECTOR, },
-	[11] = { .vector = IRQ11_VECTOR, },
-	[12] = { .vector = IRQ12_VECTOR, },
-	[13] = { .vector = IRQ13_VECTOR, },
-	[14] = { .vector = IRQ14_VECTOR, },
-	[15] = { .vector = IRQ15_VECTOR, },
-};
 
 void __init io_apic_disable_legacy(void)
 {
@@ -181,6 +164,8 @@ int __init arch_early_irq_init(void)
 	node= cpu_to_node(boot_cpu_id);
 
 	for (i = 0; i < count; i++) {
+		if (i < nr_legacy_irqs)
+			cfg[i].vector = IRQ0_VECTOR + i;
 		desc = irq_to_desc(i);
 		desc->chip_data = &cfg[i];
 		zalloc_cpumask_var_node(&cfg[i].domain, GFP_NOWAIT, node);
-- 
1.6.5.3


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2010-02-25 22:28 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-13  1:40 [PATCH 5/9] x86/ioapic: improve handling of i8259a irq init Pan, Jacob jun
2010-02-20  1:28 ` [tip:x86/mrst] x86, ioapic: Improve handling of i8259A " tip-bot for Alek Du
2010-02-24  2:49   ` [PATCH] x86: fix compiling warning with legacy_pci_xxx Yinghai Lu
2010-02-24  4:17     ` [PATCH] x86: remove left over nr_legacy_irqs Yinghai Lu
2010-02-24  4:27       ` [PATCH -v2] " Yinghai Lu
2010-02-24  8:09         ` [tip:x86/mrst] x86, legacy_irq: Remove " tip-bot for Yinghai Lu
2010-02-24 19:04         ` tip-bot for Yinghai Lu
2010-02-24 20:39         ` [PATCH] x86/pci: exclude mrst pci code for other platform Yinghai Lu
2010-02-24 21:03           ` Pan, Jacob jun
2010-02-24 21:44             ` H. Peter Anvin
2010-02-24 22:10               ` Yinghai Lu
2010-02-24 22:31                 ` H. Peter Anvin
2010-02-24 22:42                   ` Yinghai Lu
2010-02-25  0:41                     ` [PATCH] x86/mrst: add dependencies for Moorestown Pan, Jacob jun
2010-02-25  6:01                       ` Yinghai Lu
2010-02-25 22:27           ` [tip:x86/mrst] x86, pci: Exclude Moorestown PCI code if CONFIG_X86_MRST=n tip-bot for Yinghai Lu
2010-02-24  8:09     ` [tip:x86/mrst] x86, legacy_irq: Remove duplicate vector assigment tip-bot for Yinghai Lu
2010-02-24 19:04     ` tip-bot for Yinghai Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox