From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753375AbbJMR5I (ORCPT ); Tue, 13 Oct 2015 13:57:08 -0400 Received: from terminus.zytor.com ([198.137.202.10]:43050 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752966AbbJMR5F (ORCPT ); Tue, 13 Oct 2015 13:57:05 -0400 Date: Tue, 13 Oct 2015 10:56:24 -0700 From: tip-bot for Marc Zyngier Message-ID: Cc: graeme@xora.org.uk, jiang.liu@linux.intel.com, linux-arm-kernel@lists.infradead.org, tomasz.nowicki@linaro.org, linux-kernel@vger.kernel.org, hanjun.guo@linaro.org, jason@lakedaemon.net, Suravee.Suthikulpanit@amd.com, tglx@linutronix.de, marc.zyngier@arm.com, jakeo@microsoft.com, lorenzo.pieralisi@arm.com, hpa@zytor.com, rjw@rjwysocki.net, mingo@kernel.org Reply-To: tglx@linutronix.de, Suravee.Suthikulpanit@amd.com, lorenzo.pieralisi@arm.com, jakeo@microsoft.com, marc.zyngier@arm.com, mingo@kernel.org, rjw@rjwysocki.net, hpa@zytor.com, graeme@xora.org.uk, linux-arm-kernel@lists.infradead.org, jiang.liu@linux.intel.com, jason@lakedaemon.net, tomasz.nowicki@linaro.org, linux-kernel@vger.kernel.org, hanjun.guo@linaro.org In-Reply-To: <1444737105-31573-7-git-send-email-marc.zyngier@arm.com> References: <1444737105-31573-7-git-send-email-marc.zyngier@arm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/core] irqdomain: Introduce irq_create_fwspec_mapping Git-Commit-ID: c0131f09de8c2d301814cac86d78f643b8ee0574 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: c0131f09de8c2d301814cac86d78f643b8ee0574 Gitweb: http://git.kernel.org/tip/c0131f09de8c2d301814cac86d78f643b8ee0574 Author: Marc Zyngier AuthorDate: Tue, 13 Oct 2015 12:51:34 +0100 Committer: Thomas Gleixner CommitDate: Tue, 13 Oct 2015 19:01:24 +0200 irqdomain: Introduce irq_create_fwspec_mapping Just like we have irq_create_of_mapping, irq_create_fwspec_mapping creates a IRQ domain mapping for an interrupt described in a struct irq_fwspec. irq_create_of_mapping gets rewritten in terms of the new function, and the hack we introduced before gets removed (now that no stacked irqchip uses of_phandle_args anymore). Signed-off-by: Marc Zyngier Reviewed-and-tested-by: Hanjun Guo Tested-by: Lorenzo Pieralisi Cc: Cc: Tomasz Nowicki Cc: Suravee Suthikulpanit Cc: Graeme Gregory Cc: Jake Oshins Cc: Jiang Liu Cc: Jason Cooper Cc: Rafael J. Wysocki Link: http://lkml.kernel.org/r/1444737105-31573-7-git-send-email-marc.zyngier@arm.com Signed-off-by: Thomas Gleixner --- include/linux/irqdomain.h | 1 + kernel/irq/irqdomain.c | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index 533c974..7e7842e 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h @@ -267,6 +267,7 @@ extern void irq_domain_disassociate(struct irq_domain *domain, extern unsigned int irq_create_mapping(struct irq_domain *host, irq_hw_number_t hwirq); +extern unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec); extern void irq_dispose_mapping(unsigned int virq); /** diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 86dfd40..b1fda6d 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -514,37 +514,28 @@ static void of_phandle_args_to_fwspec(struct of_phandle_args *irq_data, fwspec->param[i] = irq_data->args[i]; } -unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data) +unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec) { - struct irq_fwspec fwspec; struct irq_domain *domain; irq_hw_number_t hwirq; unsigned int type = IRQ_TYPE_NONE; int virq; - of_phandle_args_to_fwspec(irq_data, &fwspec); - - if (fwspec.fwnode) - domain = irq_find_matching_fwnode(fwspec.fwnode, DOMAIN_BUS_ANY); + if (fwspec->fwnode) + domain = irq_find_matching_fwnode(fwspec->fwnode, DOMAIN_BUS_ANY); else domain = irq_default_domain; if (!domain) { pr_warn("no irq domain found for %s !\n", - of_node_full_name(to_of_node(fwspec.fwnode))); + of_node_full_name(to_of_node(fwspec->fwnode))); return 0; } - if (irq_domain_translate(domain, &fwspec, &hwirq, &type)) + if (irq_domain_translate(domain, fwspec, &hwirq, &type)) return 0; if (irq_domain_is_hierarchy(domain)) { - /* Temporary hack */ - void *desc = &fwspec; -#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY - if (!domain->ops->translate) - desc = irq_data; -#endif /* * If we've already configured this interrupt, * don't do it again, or hell will break loose. @@ -553,7 +544,7 @@ unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data) if (virq) return virq; - virq = irq_domain_alloc_irqs(domain, 1, NUMA_NO_NODE, desc); + virq = irq_domain_alloc_irqs(domain, 1, NUMA_NO_NODE, fwspec); if (virq <= 0) return 0; } else { @@ -569,6 +560,15 @@ unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data) irq_set_irq_type(virq, type); return virq; } +EXPORT_SYMBOL_GPL(irq_create_fwspec_mapping); + +unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data) +{ + struct irq_fwspec fwspec; + + of_phandle_args_to_fwspec(irq_data, &fwspec); + return irq_create_fwspec_mapping(&fwspec); +} EXPORT_SYMBOL_GPL(irq_create_of_mapping); /**