Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

genirq/MSI: Relax msi_domain_alloc() to support parentless MSI irqdomains

Previously msi_domain_alloc() assumed MSI irqdomains always had parent
irqdomains, but that's not true for the new Intel VMD devices. Relax
msi_domain_alloc() to support parentless MSI irqdomains.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>

authored by

Liu Jiang and committed by
Bjorn Helgaas
bf6f869f 1ec21837

+5 -3
+5 -3
kernel/irq/msi.c
··· 109 109 if (irq_find_mapping(domain, hwirq) > 0) 110 110 return -EEXIST; 111 111 112 - ret = irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, arg); 113 - if (ret < 0) 114 - return ret; 112 + if (domain->parent) { 113 + ret = irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, arg); 114 + if (ret < 0) 115 + return ret; 116 + } 115 117 116 118 for (i = 0; i < nr_irqs; i++) { 117 119 ret = ops->msi_init(domain, info, virq + i, hwirq + i, arg);