Skip to content

Commit 74a5257

Browse files
committed
genirq/msi: Populate sysfs entry only once
The MSI entries for multi-MSI are populated en bloc for the MSI descriptor, but the current code invokes the population inside the per interrupt loop which triggers a warning in the sysfs code and causes the interrupt allocation to fail. Move it outside of the loop so it works correctly for single and multi-MSI. Fixes: bf5e758 ("genirq/msi: Simplify sysfs handling") Reported-by: Borislav Petkov <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Tested-by: Borislav Petkov <[email protected]> Link: https://lore.kernel.org/r/87leznqx2a.ffs@tglx
1 parent d558285 commit 74a5257

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

kernel/irq/msi.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -887,12 +887,11 @@ int __msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev,
887887
ret = msi_init_virq(domain, virq + i, vflags);
888888
if (ret)
889889
return ret;
890-
891-
if (info->flags & MSI_FLAG_DEV_SYSFS) {
892-
ret = msi_sysfs_populate_desc(dev, desc);
893-
if (ret)
894-
return ret;
895-
}
890+
}
891+
if (info->flags & MSI_FLAG_DEV_SYSFS) {
892+
ret = msi_sysfs_populate_desc(dev, desc);
893+
if (ret)
894+
return ret;
896895
}
897896
allocated++;
898897
}

0 commit comments

Comments
 (0)