PCI/MSI: Register irq domain with specific token
authorMarc Zyngier <marc.zyngier@arm.com>
Tue, 28 Jul 2015 13:46:09 +0000 (14:46 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 29 Jul 2015 22:14:37 +0000 (00:14 +0200)
When creating a PCI/MSI domain, tag it with DOMAIN_BUS_PCI_MSI so
that it can be looked-up using irq_find_matching_host().

Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: <linux-arm-kernel@lists.infradead.org>
Cc: Yijing Wang <wangyijing@huawei.com>
Cc: Ma Jun <majun258@huawei.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Duc Dang <dhdang@apm.com>
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Link: http://lkml.kernel.org/r/1438091186-10244-3-git-send-email-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/pci/msi.c
include/linux/irqdomain.h

index cd4c78c193de16ce07bf544fe3f65e29bf516f30..3aae7c9ad31c8686f6eff6d13532256a6e27a732 100644 (file)
@@ -1273,12 +1273,19 @@ struct irq_domain *pci_msi_create_irq_domain(struct device_node *node,
                                             struct msi_domain_info *info,
                                             struct irq_domain *parent)
 {
+       struct irq_domain *domain;
+
        if (info->flags & MSI_FLAG_USE_DEF_DOM_OPS)
                pci_msi_domain_update_dom_ops(info);
        if (info->flags & MSI_FLAG_USE_DEF_CHIP_OPS)
                pci_msi_domain_update_chip_ops(info);
 
-       return msi_create_irq_domain(node, info, parent);
+       domain = msi_create_irq_domain(node, info, parent);
+       if (!domain)
+               return NULL;
+
+       domain->bus_token = DOMAIN_BUS_PCI_MSI;
+       return domain;
 }
 
 /**
index 91a83adf5e45849ccdf97bb68c2da0a2418a441f..25e9e6696a65c6bac8f8d52a2155ff4f3ac77a54 100644 (file)
@@ -54,6 +54,7 @@ struct irq_data;
  */
 enum irq_domain_bus_token {
        DOMAIN_BUS_ANY          = 0,
+       DOMAIN_BUS_PCI_MSI,
 };
 
 /**