All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <marc.zyngier@arm.com>
To: "J. German Rivera" <German.Rivera@freescale.com>,
	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
Date: Wed, 09 Dec 2015 15:54:46 +0000	[thread overview]
Message-ID: <56684EC6.9060101@arm.com> (raw)
In-Reply-To: <1448404284-22258-4-git-send-email-German.Rivera@freescale.com>

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@freescale.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...

  reply	other threads:[~2015-12-09 15:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24 22:31 [PATCH RESEND v3 00/11] staging: fsl-mc: MC bus MSI support J. German Rivera
2015-11-24 22:31 ` [PATCH RESEND v3 01/11] irqdomain: Added domain bus token DOMAIN_BUS_FSL_MC_MSI J. German Rivera
2015-12-09 15:45   ` Marc Zyngier
2015-11-24 22:31 ` [PATCH RESEND v3 02/11] fsl-mc: msi: Added FSL-MC-specific member to the msi_desc's union J. German Rivera
2015-12-09 15:46   ` Marc Zyngier
2015-11-24 22:31 ` [PATCH RESEND v3 03/11] staging: fsl-mc: Added generic MSI support for FSL-MC devices J. German Rivera
2015-12-09 15:54   ` Marc Zyngier [this message]
2015-11-24 22:31 ` [PATCH RESEND v3 04/11] staging: fsl-mc: Added GICv3-ITS support for FSL-MC MSIs J. German Rivera
2015-12-09 15:34   ` Marc Zyngier
2015-11-24 22:31 ` [PATCH RESEND v3 05/11] staging: fsl-mc: Extended MC bus allocator to include IRQs J. German Rivera
2015-11-24 22:31 ` [PATCH RESEND v3 06/11] staging: fsl-mc: Changed DPRC built-in portal's mc_io to be atomic J. German Rivera
2015-11-24 22:31 ` [PATCH RESEND v3 07/11] staging: fsl-mc: Populate the IRQ pool for an MC bus instance J. German Rivera
2015-11-24 22:31 ` [PATCH RESEND v3 08/11] staging: fsl-mc: set MSI domain for DPRC objects J. German Rivera
2015-11-24 22:31 ` [PATCH RESEND v3 09/11] staging: fsl-mc: Fixed bug in dprc_probe() error path J. German Rivera
2015-11-24 22:31 ` [PATCH RESEND v3 10/11] staging: fsl-mc: Added DPRC interrupt handler J. German Rivera
2015-11-24 22:31 ` [PATCH RESEND v3 11/11] staging: fsl-mc: Added MSI support to the MC bus driver J. German Rivera

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56684EC6.9060101@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=German.Rivera@freescale.com \
    --cc=R89243@freescale.com \
    --cc=agraf@suse.de \
    --cc=arnd@arndb.de \
    --cc=bhamciu1@freescale.com \
    --cc=bhupesh.sharma@freescale.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=itai.katz@freescale.com \
    --cc=jiang.liu@linux.intel.com \
    --cc=leoli@freescale.com \
    --cc=lijun.pan@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nir.erez@freescale.com \
    --cc=richard.schmitt@freescale.com \
    --cc=scottwood@freescale.com \
    --cc=stuart.yoder@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.