aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/io_apic.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-12-02 22:50:27 -0500
committerDavid S. Miller <davem@davemloft.net>2008-12-02 22:50:27 -0500
commitaa2ba5f1082dc705745899584aac8416d710c056 (patch)
treebde0bf4aff036c6bac19a0212194ae1092afb3c9 /arch/x86/kernel/io_apic.c
parent68024541e2e5a8f35e281daaa5068a29e2a538a5 (diff)
parentf6f7b52e2f6149d2ee365717afff315b05720162 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/ixgbe/ixgbe_main.c drivers/net/smc91x.c
Diffstat (limited to 'arch/x86/kernel/io_apic.c')
-rw-r--r--arch/x86/kernel/io_apic.c48
1 files changed, 22 insertions, 26 deletions
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index c9513e1ff28d..9043251210fb 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -3608,27 +3608,7 @@ int __init io_apic_get_redir_entries (int ioapic)
3608 3608
3609int __init probe_nr_irqs(void) 3609int __init probe_nr_irqs(void)
3610{ 3610{
3611 int idx; 3611 return NR_IRQS;
3612 int nr = 0;
3613#ifndef CONFIG_XEN
3614 int nr_min = 32;
3615#else
3616 int nr_min = NR_IRQS;
3617#endif
3618
3619 for (idx = 0; idx < nr_ioapics; idx++)
3620 nr += io_apic_get_redir_entries(idx) + 1;
3621
3622 /* double it for hotplug and msi and nmi */
3623 nr <<= 1;
3624
3625 /* something wrong ? */
3626 if (nr < nr_min)
3627 nr = nr_min;
3628 if (WARN_ON(nr > NR_IRQS))
3629 nr = NR_IRQS;
3630
3631 return nr;
3632} 3612}
3633 3613
3634/* -------------------------------------------------------------------------- 3614/* --------------------------------------------------------------------------
@@ -3775,7 +3755,9 @@ int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity)
3775void __init setup_ioapic_dest(void) 3755void __init setup_ioapic_dest(void)
3776{ 3756{
3777 int pin, ioapic, irq, irq_entry; 3757 int pin, ioapic, irq, irq_entry;
3758 struct irq_desc *desc;
3778 struct irq_cfg *cfg; 3759 struct irq_cfg *cfg;
3760 cpumask_t mask;
3779 3761
3780 if (skip_ioapic_setup == 1) 3762 if (skip_ioapic_setup == 1)
3781 return; 3763 return;
@@ -3792,16 +3774,30 @@ void __init setup_ioapic_dest(void)
3792 * cpu is online. 3774 * cpu is online.
3793 */ 3775 */
3794 cfg = irq_cfg(irq); 3776 cfg = irq_cfg(irq);
3795 if (!cfg->vector) 3777 if (!cfg->vector) {
3796 setup_IO_APIC_irq(ioapic, pin, irq, 3778 setup_IO_APIC_irq(ioapic, pin, irq,
3797 irq_trigger(irq_entry), 3779 irq_trigger(irq_entry),
3798 irq_polarity(irq_entry)); 3780 irq_polarity(irq_entry));
3781 continue;
3782
3783 }
3784
3785 /*
3786 * Honour affinities which have been set in early boot
3787 */
3788 desc = irq_to_desc(irq);
3789 if (desc->status &
3790 (IRQ_NO_BALANCING | IRQ_AFFINITY_SET))
3791 mask = desc->affinity;
3792 else
3793 mask = TARGET_CPUS;
3794
3799#ifdef CONFIG_INTR_REMAP 3795#ifdef CONFIG_INTR_REMAP
3800 else if (intr_remapping_enabled) 3796 if (intr_remapping_enabled)
3801 set_ir_ioapic_affinity_irq(irq, TARGET_CPUS); 3797 set_ir_ioapic_affinity_irq(irq, mask);
3802#endif
3803 else 3798 else
3804 set_ioapic_affinity_irq(irq, TARGET_CPUS); 3799#endif
3800 set_ioapic_affinity_irq(irq, mask);
3805 } 3801 }
3806 3802
3807 } 3803 }