Skip to content

Commit 596a7a1

Browse files
johnkeepingKAGA-KOKO
authored andcommitted
genirq/msi: Fix populating multiple interrupts
On allocating the interrupts routed via a wire-to-MSI bridge, the allocator iterates over the MSI descriptors to build the hierarchy, but fails to use the descriptor interrupt number, and instead uses the base number, generating the wrong IRQ domain mappings. The fix is to use the MSI descriptor interrupt number when setting up the interrupt instead of the base interrupt for the allocation range. The only saving grace is that although the MSI descriptors are allocated in bulk, the wired interrupts are only allocated one by one (so desc->irq == virq) and the bug went unnoticed so far. Fixes: 2145ac9 ("genirq/msi: Add msi_domain_populate_irqs") Signed-off-by: John Keeping <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Marc Zyngier <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected]
1 parent 24e700e commit 596a7a1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

kernel/irq/msi.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,12 @@ int msi_domain_populate_irqs(struct irq_domain *domain, struct device *dev,
315315

316316
ops->set_desc(arg, desc);
317317
/* Assumes the domain mutex is held! */
318-
ret = irq_domain_alloc_irqs_hierarchy(domain, virq, 1, arg);
318+
ret = irq_domain_alloc_irqs_hierarchy(domain, desc->irq, 1,
319+
arg);
319320
if (ret)
320321
break;
321322

322-
irq_set_msi_desc_off(virq, 0, desc);
323+
irq_set_msi_desc_off(desc->irq, 0, desc);
323324
}
324325

325326
if (ret) {

0 commit comments

Comments
 (0)