From patchwork Fri Sep 11 00:01:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jake Oshins X-Patchwork-Id: 7156481 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 147B59F314 for ; Fri, 11 Sep 2015 00:09:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 237CE2080E for ; Fri, 11 Sep 2015 00:09:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 126C020823 for ; Fri, 11 Sep 2015 00:09:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751884AbbIKAJv (ORCPT ); Thu, 10 Sep 2015 20:09:51 -0400 Received: from o1.f.az.sendgrid.net ([208.117.55.132]:35083 "EHLO o1.f.az.sendgrid.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751728AbbIKAJo (ORCPT ); Thu, 10 Sep 2015 20:09:44 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:cc:subject:in-reply-to:references; s=smtpapi; bh=aIjh8/6prVmgU+FFLQ4fEgkaPqE=; b=X2PEXd8mXWJVYZC45BnBZ4uUuKuT7 r/IbIVuVVjuF3jcuTz4M92EwbY0wSnB0F/1I3FN4wivH0WDJuA1Riq5Ft/frTGmN /A/2RnPX5SqNOitXPDThxCCqJhZKUiMQWszVJsJBRnRIU1akc+uRq1hbeoKcnC2U TJhh4fwFZojjaQ= Received: by filter-487.sjc1.sendgrid.net with SMTP id filter-487.7895.55F21A7F14 2015-09-11 00:04:15.993738652 +0000 UTC Received: from jakeoshinsu2.jakeoshinsu2.d1.internal.cloudapp.net (unknown [104.210.40.47]) by ismtpd-046 (SG) with ESMTP id 14fb9b78230.502f.1adb9f6 Fri, 11 Sep 2015 00:04:15 +0000 (UTC) From: jakeo@microsoft.com To: gregkh@linuxfoundation.org, kys@microsoft.com, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, vkuznets@redhat.com, linux-pci@vger.kernel.org, bhelgaas@google.com, tglx@linutronix.de Cc: Jake Oshins Subject: [PATCH v2 02/12] kernel:irq: Change signature of irq_find_matching_host() Date: Fri, 11 Sep 2015 00:01:01 +0000 Message-Id: <1441929670-10058-3-git-send-email-jakeo@microsoft.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1441929670-10058-1-git-send-email-jakeo@microsoft.com> References: <1441929670-10058-1-git-send-email-jakeo@microsoft.com> X-SG-EID: lfnueJVzSjg1mfuVqqukVH7tZvRy9mfCIcBnfbfzaMMWVgeXPdEksBJQKTtitQJWk9g5yLLYnx1/VW QWcjDFDmr3595fNVwjjcEjLUgA8HoeeW6qaZvXPfI/yNJMMfOAjPERrF7vghzzfgzt2lLfgPj6aPPi eOHYF/rn1RO62/Q= Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY, URIBL_GREY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jake Oshins In order to use the facility introduced in the last patch (the ability to match on both bus type and something that identifies the specific bus of that type,) irq_find_matching_host() needs to take that bus-specific parameter. Signed-off-by: Jake Oshins --- drivers/irqchip/irq-gic-v3-its-pci-msi.c | 2 +- drivers/irqchip/irq-gic-v3-its-platform-msi.c | 2 +- drivers/of/irq.c | 2 +- drivers/pci/of.c | 2 +- include/linux/irqdomain.h | 5 +++-- kernel/irq/irqdomain.c | 6 ++++-- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its-pci-msi.c b/drivers/irqchip/irq-gic-v3-its-pci-msi.c index cf351c6..51521b5 100644 --- a/drivers/irqchip/irq-gic-v3-its-pci-msi.c +++ b/drivers/irqchip/irq-gic-v3-its-pci-msi.c @@ -118,7 +118,7 @@ static int __init its_pci_msi_init(void) if (!of_property_read_bool(np, "msi-controller")) continue; - parent = irq_find_matching_host(np, DOMAIN_BUS_NEXUS); + parent = irq_find_matching_host(np, DOMAIN_BUS_NEXUS, NULL); if (!parent || !msi_get_domain_info(parent)) { pr_err("%s: unable to locate ITS domain\n", np->full_name); diff --git a/drivers/irqchip/irq-gic-v3-its-platform-msi.c b/drivers/irqchip/irq-gic-v3-its-platform-msi.c index a865505..5a3ac02 100644 --- a/drivers/irqchip/irq-gic-v3-its-platform-msi.c +++ b/drivers/irqchip/irq-gic-v3-its-platform-msi.c @@ -71,7 +71,7 @@ static int __init its_pmsi_init(void) if (!of_property_read_bool(np, "msi-controller")) continue; - parent = irq_find_matching_host(np, DOMAIN_BUS_NEXUS); + parent = irq_find_matching_host(np, DOMAIN_BUS_NEXUS, NULL); if (!parent || !msi_get_domain_info(parent)) { pr_err("%s: unable to locate ITS domain\n", np->full_name); diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 55317fa..1c9c944 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -593,7 +593,7 @@ void of_msi_configure(struct device *dev, struct device_node *np) if (!msi_np) return; - d = irq_find_matching_host(msi_np, DOMAIN_BUS_PLATFORM_MSI); + d = irq_find_matching_host(msi_np, DOMAIN_BUS_PLATFORM_MSI, NULL); if (!d) d = irq_find_host(msi_np); dev_set_msi_domain(dev, d); diff --git a/drivers/pci/of.c b/drivers/pci/of.c index 2e99a50..0da3bce 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -80,7 +80,7 @@ struct irq_domain *pci_host_bridge_of_msi_domain(struct pci_bus *bus) if (!np) np = bus->dev.of_node; - d = irq_find_matching_host(np, DOMAIN_BUS_PCI_MSI); + d = irq_find_matching_host(np, DOMAIN_BUS_PCI_MSI, NULL); if (d) return d; diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index 4d89f98..12acddb 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h @@ -178,12 +178,13 @@ struct irq_domain *irq_domain_add_legacy(struct device_node *of_node, const struct irq_domain_ops *ops, void *host_data); extern struct irq_domain *irq_find_matching_host(struct device_node *node, - enum irq_domain_bus_token bus_token); + enum irq_domain_bus_token bus_token, + void *bus_data); extern void irq_set_default_host(struct irq_domain *host); static inline struct irq_domain *irq_find_host(struct device_node *node) { - return irq_find_matching_host(node, DOMAIN_BUS_ANY); + return irq_find_matching_host(node, DOMAIN_BUS_ANY, NULL); } /** diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 8a8ef31..b4c15af 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -190,9 +190,11 @@ EXPORT_SYMBOL_GPL(irq_domain_add_legacy); * irq_find_matching_host() - Locates a domain for a given device node * @node: device-tree node of the interrupt controller * @bus_token: domain-specific data + * @bus_data: bus-specific data */ struct irq_domain *irq_find_matching_host(struct device_node *node, - enum irq_domain_bus_token bus_token) + enum irq_domain_bus_token bus_token, + void *bus_data) { struct irq_domain *h, *found = NULL; int rc; @@ -209,7 +211,7 @@ struct irq_domain *irq_find_matching_host(struct device_node *node, mutex_lock(&irq_domain_mutex); list_for_each_entry(h, &irq_domain_list, link) { if (h->ops->match) - rc = h->ops->match(h, node, bus_token, NULL); + rc = h->ops->match(h, node, bus_token, bus_data); else rc = ((h->of_node != NULL) && (h->of_node == node) && ((bus_token == DOMAIN_BUS_ANY) ||