aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/io_apic.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/io_apic.c')
-rw-r--r--arch/x86/kernel/io_apic.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index 9578d33f20a0..43f95d7b13af 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -3479,9 +3479,9 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
3479 sub_handle = 0; 3479 sub_handle = 0;
3480 list_for_each_entry(msidesc, &dev->msi_list, list) { 3480 list_for_each_entry(msidesc, &dev->msi_list, list) {
3481 irq = create_irq_nr(irq_want); 3481 irq = create_irq_nr(irq_want);
3482 irq_want++;
3483 if (irq == 0) 3482 if (irq == 0)
3484 return -1; 3483 return -1;
3484 irq_want = irq + 1;
3485#ifdef CONFIG_INTR_REMAP 3485#ifdef CONFIG_INTR_REMAP
3486 if (!intr_remapping_enabled) 3486 if (!intr_remapping_enabled)
3487 goto no_ir; 3487 goto no_ir;
@@ -3825,11 +3825,17 @@ int __init arch_probe_nr_irqs(void)
3825{ 3825{
3826 int nr; 3826 int nr;
3827 3827
3828 nr = ((8 * nr_cpu_ids) > (32 * nr_ioapics) ? 3828 if (nr_irqs > (NR_VECTORS * nr_cpu_ids))
3829 (NR_VECTORS + (8 * nr_cpu_ids)) : 3829 nr_irqs = NR_VECTORS * nr_cpu_ids;
3830 (NR_VECTORS + (32 * nr_ioapics)));
3831 3830
3832 if (nr < nr_irqs && nr > nr_irqs_gsi) 3831 nr = nr_irqs_gsi + 8 * nr_cpu_ids;
3832#if defined(CONFIG_PCI_MSI) || defined(CONFIG_HT_IRQ)
3833 /*
3834 * for MSI and HT dyn irq
3835 */
3836 nr += nr_irqs_gsi * 16;
3837#endif
3838 if (nr < nr_irqs)
3833 nr_irqs = nr; 3839 nr_irqs = nr;
3834 3840
3835 return 0; 3841 return 0;