From: Joerg Roedel Date: Fri, 6 Oct 2017 10:22:06 +0000 (+0200) Subject: iommu/amd: Enforce alignment for MSI IRQs X-Git-Tag: v5.15~10028^2^5~1^4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=53b9ec3fbb7da97d13951debbd42e3a0c4a7c9f7;p=platform%2Fkernel%2Flinux-starfive.git iommu/amd: Enforce alignment for MSI IRQs Make use of the new alignment capability of alloc_irq_index() to enforce IRQ index alignment for MSI. Reported-by: Thomas Gleixner Fixes: 2b324506341cb ('iommu/amd: Add routines to manage irq remapping tables') Reviewed-by: Thomas Gleixner Signed-off-by: Joerg Roedel --- diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 2d4ee25..cb7c531 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -4102,7 +4102,9 @@ static int irq_remapping_alloc(struct irq_domain *domain, unsigned int virq, else ret = -ENOMEM; } else { - index = alloc_irq_index(devid, nr_irqs, false); + bool align = (info->type == X86_IRQ_ALLOC_TYPE_MSI); + + index = alloc_irq_index(devid, nr_irqs, align); } if (index < 0) { pr_warn("Failed to allocate IRTE\n");