diff options
Diffstat (limited to 'drivers/iommu/intel_irq_remapping.c')
-rw-r--r-- | drivers/iommu/intel_irq_remapping.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c index 6d347064b8b0..dafbad06390a 100644 --- a/drivers/iommu/intel_irq_remapping.c +++ b/drivers/iommu/intel_irq_remapping.c | |||
@@ -924,6 +924,7 @@ intel_ioapic_set_affinity(struct irq_data *data, const struct cpumask *mask, | |||
924 | struct irq_cfg *cfg = data->chip_data; | 924 | struct irq_cfg *cfg = data->chip_data; |
925 | unsigned int dest, irq = data->irq; | 925 | unsigned int dest, irq = data->irq; |
926 | struct irte irte; | 926 | struct irte irte; |
927 | int err; | ||
927 | 928 | ||
928 | if (!cpumask_intersects(mask, cpu_online_mask)) | 929 | if (!cpumask_intersects(mask, cpu_online_mask)) |
929 | return -EINVAL; | 930 | return -EINVAL; |
@@ -931,10 +932,16 @@ intel_ioapic_set_affinity(struct irq_data *data, const struct cpumask *mask, | |||
931 | if (get_irte(irq, &irte)) | 932 | if (get_irte(irq, &irte)) |
932 | return -EBUSY; | 933 | return -EBUSY; |
933 | 934 | ||
934 | if (assign_irq_vector(irq, cfg, mask)) | 935 | err = assign_irq_vector(irq, cfg, mask); |
935 | return -EBUSY; | 936 | if (err) |
937 | return err; | ||
936 | 938 | ||
937 | dest = apic->cpu_mask_to_apicid_and(cfg->domain, mask); | 939 | err = apic->cpu_mask_to_apicid_and(cfg->domain, mask, &dest); |
940 | if (err) { | ||
941 | if (assign_irq_vector(irq, cfg, data->affinity)); | ||
942 | pr_err("Failed to recover vector for irq %d\n", irq); | ||
943 | return err; | ||
944 | } | ||
938 | 945 | ||
939 | irte.vector = cfg->vector; | 946 | irte.vector = cfg->vector; |
940 | irte.dest_id = IRTE_DEST(dest); | 947 | irte.dest_id = IRTE_DEST(dest); |