genirq/MSI: Relax msi_domain_alloc() to support parentless MSI irqdomains
authorLiu Jiang <jiang.liu@linux.intel.com>
Tue, 12 Jan 2016 20:18:06 +0000 (13:18 -0700)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 14 Jan 2016 19:59:09 +0000 (13:59 -0600)
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>
kernel/irq/msi.c

index 6b0c0b74a2a1a88c0d3f81519fea7c520b290967..5e15cb4b2f0097fa025af0a9f22f0dee0f22f2b0 100644 (file)
@@ -109,9 +109,11 @@ static int msi_domain_alloc(struct irq_domain *domain, unsigned int virq,
        if (irq_find_mapping(domain, hwirq) > 0)
                return -EEXIST;
 
-       ret = irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, arg);
-       if (ret < 0)
-               return ret;
+       if (domain->parent) {
+               ret = irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, arg);
+               if (ret < 0)
+                       return ret;
+       }
 
        for (i = 0; i < nr_irqs; i++) {
                ret = ops->msi_init(domain, info, virq + i, hwirq + i, arg);