aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-05-07 11:44:07 -0400
committerThomas Gleixner <tglx@linutronix.de>2014-05-16 08:05:18 -0400
commitd24a135412ab4dba50eb7aeffd4064eee23b4da6 (patch)
tree6d293202017d98e951323d82943898e5611ace79
parentb1ee544174fd0eb28a7770403b9577fd70f1cd3d (diff)
x86: irq_remapping: Use irq_alloc/free_hwirq()
The create_irq variants are going away. Use the new interface. The core and arch code already excludes the gsi interrupts from the allocation, so no functional change. This does not replace the requirement to move x86 to irq domains, but it limits the mess to some degree. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Grant Likely <grant.likely@linaro.org> Cc: Tony Luck <tony.luck@intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Acked-by: Joerg Roedel <joro@8bytes.org> Cc: x86@kernel.org Cc: iommu@lists.linux-foundation.org Link: http://lkml.kernel.org/r/20140507154334.741805075@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--drivers/iommu/irq_remapping.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c
index 228632c99adb..33c439524080 100644
--- a/drivers/iommu/irq_remapping.c
+++ b/drivers/iommu/irq_remapping.c
@@ -51,7 +51,7 @@ static void irq_remapping_disable_io_apic(void)
51 51
52static int do_setup_msi_irqs(struct pci_dev *dev, int nvec) 52static int do_setup_msi_irqs(struct pci_dev *dev, int nvec)
53{ 53{
54 int node, ret, sub_handle, nvec_pow2, index = 0; 54 int ret, sub_handle, nvec_pow2, index = 0;
55 unsigned int irq; 55 unsigned int irq;
56 struct msi_desc *msidesc; 56 struct msi_desc *msidesc;
57 57
@@ -61,8 +61,7 @@ static int do_setup_msi_irqs(struct pci_dev *dev, int nvec)
61 WARN_ON(msidesc->msi_attrib.multiple); 61 WARN_ON(msidesc->msi_attrib.multiple);
62 WARN_ON(msidesc->nvec_used); 62 WARN_ON(msidesc->nvec_used);
63 63
64 node = dev_to_node(&dev->dev); 64 irq = irq_alloc_hwirqs(nvec, dev_to_node(&dev->dev));
65 irq = __create_irqs(get_nr_irqs_gsi(), nvec, node);
66 if (irq == 0) 65 if (irq == 0)
67 return -ENOSPC; 66 return -ENOSPC;
68 67
@@ -89,7 +88,7 @@ static int do_setup_msi_irqs(struct pci_dev *dev, int nvec)
89 return 0; 88 return 0;
90 89
91error: 90error:
92 destroy_irqs(irq, nvec); 91 irq_free_hwirqs(irq, nvec);
93 92
94 /* 93 /*
95 * Restore altered MSI descriptor fields and prevent just destroyed 94 * Restore altered MSI descriptor fields and prevent just destroyed
@@ -109,12 +108,11 @@ static int do_setup_msix_irqs(struct pci_dev *dev, int nvec)
109 unsigned int irq; 108 unsigned int irq;
110 109
111 node = dev_to_node(&dev->dev); 110 node = dev_to_node(&dev->dev);
112 irq = get_nr_irqs_gsi();
113 sub_handle = 0; 111 sub_handle = 0;
114 112
115 list_for_each_entry(msidesc, &dev->msi_list, list) { 113 list_for_each_entry(msidesc, &dev->msi_list, list) {
116 114
117 irq = create_irq_nr(irq, node); 115 irq = irq_alloc_hwirq(node);
118 if (irq == 0) 116 if (irq == 0)
119 return -1; 117 return -1;
120 118
@@ -137,7 +135,7 @@ static int do_setup_msix_irqs(struct pci_dev *dev, int nvec)
137 return 0; 135 return 0;
138 136
139error: 137error:
140 destroy_irq(irq); 138 irq_free_hwirq(irq);
141 return ret; 139 return ret;
142} 140}
143 141