[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <56684EC6.9060101@arm.com>
Date: Wed, 09 Dec 2015 15:54:46 +0000
From: Marc Zyngier <marc.zyngier@....com>
To: "J. German Rivera" <German.Rivera@...escale.com>,
gregkh@...uxfoundation.org, arnd@...db.de,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
CC: stuart.yoder@...escale.com, itai.katz@...escale.com,
lijun.pan@...escale.com, leoli@...escale.com,
scottwood@...escale.com, agraf@...e.de, bhamciu1@...escale.com,
R89243@...escale.com, bhupesh.sharma@...escale.com,
nir.erez@...escale.com, richard.schmitt@...escale.com,
dan.carpenter@...cle.com, jiang.liu@...ux.intel.com
Subject: Re: [PATCH RESEND v3 03/11] staging: fsl-mc: Added generic MSI support
for FSL-MC devices
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 <German.Rivera@...escale.com>
> ---
> 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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists