summaryrefslogtreecommitdiffstats
path: root/drivers/pci/intr_remapping.c
diff options
context:
space:
mode:
authorSuresh Siddha <suresh.b.siddha@intel.com>2008-08-20 17:22:51 -0700
committerIngo Molnar <mingo@elte.hu>2008-10-16 16:52:59 +0200
commit7ddfb650c7ef7a33a5ef11c0fdf5b3d837a47dba (patch)
tree08095ab77f9ca60ccb8b3c4d870e0ddcd9c54f0b /drivers/pci/intr_remapping.c
parent0c425cec64eb0c0d0dd7037c21a25585cbe3636c (diff)
sparseirq: fix intr-remap with dyn_array/nr_irqs changes]
In irq_2_iommu_alloc() and set_irte_irq(), irq_to_desc or irq_2_iommu pointers may not be allocated. So use the routines which will allocate them if they are not already allocated. Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/pci/intr_remapping.c')
-rw-r--r--drivers/pci/intr_remapping.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c
index 23372c81115..2dcf973890c 100644
--- a/drivers/pci/intr_remapping.c
+++ b/drivers/pci/intr_remapping.c
@@ -76,9 +76,10 @@ static struct irq_2_iommu *irq_2_iommu_alloc(unsigned int irq)
struct irq_desc *desc;
struct irq_2_iommu *irq_iommu;
- desc = irq_to_desc(irq);
-
- BUG_ON(!desc);
+ /*
+ * alloc irq desc if not allocated already.
+ */
+ desc = irq_to_desc_alloc(irq);
irq_iommu = desc->irq_2_iommu;
@@ -255,11 +256,8 @@ int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index, u16 subhandle)
struct irq_2_iommu *irq_iommu;
spin_lock(&irq_2_ir_lock);
- irq_iommu = valid_irq_2_iommu(irq);
- if (!irq_iommu) {
- spin_unlock(&irq_2_ir_lock);
- return -1;
- }
+
+ irq_iommu = irq_2_iommu_alloc(irq);
irq_iommu->iommu = iommu;
irq_iommu->irte_index = index;