Skip to content

Commit 0652644

Browse files
Marc ZyngierKAGA-KOKO
authored andcommitted
irqchip/msi-lib: Honour the MSI_FLAG_NO_AFFINITY flag
Bad MSI implementations multiplex MSIs onto a single downstream interrupt, meaning they have no concept of individual affinity. The old MSI code did a reasonable job at this by honouring the MSI_FLAG_NO_AFFINITY, but the new shiny device MSI code doesn't. Teach it about the sad reality of existing hardware. Signed-off-by: Marc Zyngier <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent b35961c commit 0652644

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/irqchip/irq-msi-lib.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,13 @@ bool msi_lib_init_dev_msi_info(struct device *dev, struct irq_domain *domain,
105105
* MSI message into the hardware which is the whole purpose of the
106106
* device MSI domain aside of mask/unmask which is provided e.g. by
107107
* PCI/MSI device domains.
108+
*
109+
* The exception to the rule is when the underlying domain
110+
* tells you that affinity is not a thing -- for example when
111+
* everything is muxed behind a single interrupt.
108112
*/
109-
chip->irq_set_affinity = msi_domain_set_affinity;
113+
if (!chip->irq_set_affinity && !(info->flags & MSI_FLAG_NO_AFFINITY))
114+
chip->irq_set_affinity = msi_domain_set_affinity;
110115
return true;
111116
}
112117
EXPORT_SYMBOL_GPL(msi_lib_init_dev_msi_info);

0 commit comments

Comments
 (0)