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>
This commit is contained in:
parent
0c425cec64
commit
7ddfb650c7
@ -76,9 +76,10 @@ static struct irq_2_iommu *irq_2_iommu_alloc(unsigned int irq)
|
|||||||
struct irq_desc *desc;
|
struct irq_desc *desc;
|
||||||
struct irq_2_iommu *irq_iommu;
|
struct irq_2_iommu *irq_iommu;
|
||||||
|
|
||||||
desc = irq_to_desc(irq);
|
/*
|
||||||
|
* alloc irq desc if not allocated already.
|
||||||
BUG_ON(!desc);
|
*/
|
||||||
|
desc = irq_to_desc_alloc(irq);
|
||||||
|
|
||||||
irq_iommu = desc->irq_2_iommu;
|
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;
|
struct irq_2_iommu *irq_iommu;
|
||||||
|
|
||||||
spin_lock(&irq_2_ir_lock);
|
spin_lock(&irq_2_ir_lock);
|
||||||
irq_iommu = valid_irq_2_iommu(irq);
|
|
||||||
if (!irq_iommu) {
|
irq_iommu = irq_2_iommu_alloc(irq);
|
||||||
spin_unlock(&irq_2_ir_lock);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
irq_iommu->iommu = iommu;
|
irq_iommu->iommu = iommu;
|
||||||
irq_iommu->irte_index = index;
|
irq_iommu->irte_index = index;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user