Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752021AbbLIPyv (ORCPT ); Wed, 9 Dec 2015 10:54:51 -0500 Received: from foss.arm.com ([217.140.101.70]:50434 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750826AbbLIPyu (ORCPT ); Wed, 9 Dec 2015 10:54:50 -0500 Message-ID: <56684EC6.9060101@arm.com> Date: Wed, 09 Dec 2015 15:54:46 +0000 From: Marc Zyngier Organization: ARM Ltd User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: "J. German Rivera" , gregkh@linuxfoundation.org, arnd@arndb.de, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org CC: stuart.yoder@freescale.com, itai.katz@freescale.com, lijun.pan@freescale.com, leoli@freescale.com, scottwood@freescale.com, agraf@suse.de, bhamciu1@freescale.com, R89243@freescale.com, bhupesh.sharma@freescale.com, nir.erez@freescale.com, richard.schmitt@freescale.com, dan.carpenter@oracle.com, jiang.liu@linux.intel.com Subject: Re: [PATCH RESEND v3 03/11] staging: fsl-mc: Added generic MSI support for FSL-MC devices References: <1448404284-22258-1-git-send-email-German.Rivera@freescale.com> <1448404284-22258-4-git-send-email-German.Rivera@freescale.com> In-Reply-To: <1448404284-22258-4-git-send-email-German.Rivera@freescale.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2535 Lines: 81 On 24/11/15 22:31, J. German Rivera wrote: > Created an MSI domain for the fsl-mc bus-- including functions > to create a domain, find a domain, alloc/free domain irqs, and > bus specific overrides for domain and irq_chip ops. > > Signed-off-by: J. German Rivera > --- > CHANGE HISTORY > > Changes in v3: > - Addressed comments from Marc Zyngier: > * Added WARN_ON in fsl_mc_msi_set_desc to check that caller does > not set set_desc > * Changed type of paddr in irq_cfg to be phys_addr_t > * Added WARN_ON in fsl_mc_msi_update_chip_op() to check that caller > does not set irq_write_msi_msg > > Changes in v2: none > > drivers/staging/fsl-mc/bus/Kconfig | 1 + > drivers/staging/fsl-mc/bus/Makefile | 1 + > drivers/staging/fsl-mc/bus/mc-msi.c | 285 ++++++++++++++++++++++++++++ > drivers/staging/fsl-mc/include/dprc.h | 2 +- > drivers/staging/fsl-mc/include/mc-private.h | 17 ++ > drivers/staging/fsl-mc/include/mc.h | 17 ++ > 6 files changed, 322 insertions(+), 1 deletion(-) > create mode 100644 drivers/staging/fsl-mc/bus/mc-msi.c > [...] > diff --git a/drivers/staging/fsl-mc/bus/mc-msi.c b/drivers/staging/fsl-mc/bus/mc-msi.c > new file mode 100644 > index 0000000..d6ac465 > --- /dev/null > +++ b/drivers/staging/fsl-mc/bus/mc-msi.c [...] > +int fsl_mc_find_msi_domain(struct device_node *mc_of_node, > + struct irq_domain **mc_msi_domain) > +{ > + struct device_node *msi_parent_node; > + struct irq_domain *msi_domain; > + > + msi_parent_node = of_parse_phandle(mc_of_node, "msi-parent", 0); > + if (!msi_parent_node) { > + pr_err("msi-parent phandle missing for %s\n", > + mc_of_node->full_name); > + return -ENOENT; > + } > + > + /* > + * Look up the fsl-mc MSI domain: > + */ > + msi_domain = irq_find_matching_host(msi_parent_node, > + DOMAIN_BUS_FSL_MC_MSI); > + if (!msi_domain) { > + pr_err("Unable to find fsl-mc MSI domain for %s\n", > + mc_of_node->full_name); > + > + return -ENOENT; > + } > + > + *mc_msi_domain = msi_domain; > + return 0; > +} We now have of_msi_get_domain() which does deal with this (and more). It is probably worth investigating switching to it. Thanks, M. -- Jazz is not dead. It just smells funny... -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/