All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Marc Zyngier <marc.zyngier@arm.com>
Cc: Rob Herring <robh+dt@kernel.org>,
	Jason Cooper <jason@lakedaemon.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Bjorn Helgaas <bhelgaas@google.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org,
	Mark Rutland <Mark.Rutland@arm.com>,
	David Daney <ddaney.cavm@gmail.com>,
	Robin Murphy <robin.murphy@arm.com>
Subject: Re: [PATCH v2 3/8] PCI/MSI: Use of_msi_get_domain instead of open-coded "msi-parent" parsing
Date: Thu, 15 Oct 2015 15:10:50 -0500	[thread overview]
Message-ID: <20151015201050.GC10442@localhost> (raw)
In-Reply-To: <1444151043-31084-4-git-send-email-marc.zyngier@arm.com>

On Tue, Oct 06, 2015 at 06:03:58PM +0100, Marc Zyngier wrote:
> Now that we have a function that implements the complexity of the
> "msi-parent" property parsing, switch to that.
> 
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

> ---
>  drivers/pci/of.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/pci/of.c b/drivers/pci/of.c
> index 2e99a50..e112da1 100644
> --- a/drivers/pci/of.c
> +++ b/drivers/pci/of.c
> @@ -13,6 +13,7 @@
>  #include <linux/kernel.h>
>  #include <linux/pci.h>
>  #include <linux/of.h>
> +#include <linux/of_irq.h>
>  #include <linux/of_pci.h>
>  #include "pci.h"
>  
> @@ -64,27 +65,25 @@ struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus)
>  struct irq_domain *pci_host_bridge_of_msi_domain(struct pci_bus *bus)
>  {
>  #ifdef CONFIG_IRQ_DOMAIN
> -	struct device_node *np;
>  	struct irq_domain *d;
>  
>  	if (!bus->dev.of_node)
>  		return NULL;
>  
>  	/* Start looking for a phandle to an MSI controller. */
> -	np = of_parse_phandle(bus->dev.of_node, "msi-parent", 0);
> +	d = of_msi_get_domain(&bus->dev, bus->dev.of_node, DOMAIN_BUS_PCI_MSI);
> +	if (d)
> +		return d;
>  
>  	/*
>  	 * If we don't have an msi-parent property, look for a domain
>  	 * directly attached to the host bridge.
>  	 */
> -	if (!np)
> -		np = bus->dev.of_node;
> -
> -	d = irq_find_matching_host(np, DOMAIN_BUS_PCI_MSI);
> +	d = irq_find_matching_host(bus->dev.of_node, DOMAIN_BUS_PCI_MSI);
>  	if (d)
>  		return d;
>  
> -	return irq_find_host(np);
> +	return irq_find_host(bus->dev.of_node);
>  #else
>  	return NULL;
>  #endif
> -- 
> 2.1.4
> 
> --
> 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/

WARNING: multiple messages have this Message-ID (diff)
From: helgaas@kernel.org (Bjorn Helgaas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/8] PCI/MSI: Use of_msi_get_domain instead of open-coded "msi-parent" parsing
Date: Thu, 15 Oct 2015 15:10:50 -0500	[thread overview]
Message-ID: <20151015201050.GC10442@localhost> (raw)
In-Reply-To: <1444151043-31084-4-git-send-email-marc.zyngier@arm.com>

On Tue, Oct 06, 2015 at 06:03:58PM +0100, Marc Zyngier wrote:
> Now that we have a function that implements the complexity of the
> "msi-parent" property parsing, switch to that.
> 
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

> ---
>  drivers/pci/of.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/pci/of.c b/drivers/pci/of.c
> index 2e99a50..e112da1 100644
> --- a/drivers/pci/of.c
> +++ b/drivers/pci/of.c
> @@ -13,6 +13,7 @@
>  #include <linux/kernel.h>
>  #include <linux/pci.h>
>  #include <linux/of.h>
> +#include <linux/of_irq.h>
>  #include <linux/of_pci.h>
>  #include "pci.h"
>  
> @@ -64,27 +65,25 @@ struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus)
>  struct irq_domain *pci_host_bridge_of_msi_domain(struct pci_bus *bus)
>  {
>  #ifdef CONFIG_IRQ_DOMAIN
> -	struct device_node *np;
>  	struct irq_domain *d;
>  
>  	if (!bus->dev.of_node)
>  		return NULL;
>  
>  	/* Start looking for a phandle to an MSI controller. */
> -	np = of_parse_phandle(bus->dev.of_node, "msi-parent", 0);
> +	d = of_msi_get_domain(&bus->dev, bus->dev.of_node, DOMAIN_BUS_PCI_MSI);
> +	if (d)
> +		return d;
>  
>  	/*
>  	 * If we don't have an msi-parent property, look for a domain
>  	 * directly attached to the host bridge.
>  	 */
> -	if (!np)
> -		np = bus->dev.of_node;
> -
> -	d = irq_find_matching_host(np, DOMAIN_BUS_PCI_MSI);
> +	d = irq_find_matching_host(bus->dev.of_node, DOMAIN_BUS_PCI_MSI);
>  	if (d)
>  		return d;
>  
> -	return irq_find_host(np);
> +	return irq_find_host(bus->dev.of_node);
>  #else
>  	return NULL;
>  #endif
> -- 
> 2.1.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

  reply	other threads:[~2015-10-15 20:10 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-06 17:03 [PATCH v2 0/8] of: Handle multi-parent version of msi-parent & msi-map Marc Zyngier
2015-10-06 17:03 ` Marc Zyngier
2015-10-06 17:03 ` [PATCH v2 1/8] of/irq: Add support code for multi-parent version of "msi-parent" Marc Zyngier
2015-10-06 17:03   ` Marc Zyngier
2015-10-06 17:03 ` [PATCH v2 2/8] of/irq: Use of_msi_get_domain instead of open-coded "msi-parent" parsing Marc Zyngier
2015-10-06 17:03   ` Marc Zyngier
2015-10-06 17:03 ` [PATCH v2 3/8] PCI/MSI: " Marc Zyngier
2015-10-06 17:03   ` Marc Zyngier
2015-10-15 20:10   ` Bjorn Helgaas [this message]
2015-10-15 20:10     ` Bjorn Helgaas
2015-10-06 17:03 ` [PATCH v2 4/8] irqchip/gic-v3-its: Parse new version of msi-parent property Marc Zyngier
2015-10-06 17:03   ` Marc Zyngier
2015-10-06 17:04 ` [PATCH v2 5/8] of/irq: Split of_msi_map_rid to reuse msi-map lookup Marc Zyngier
2015-10-06 17:04   ` Marc Zyngier
2015-10-06 17:04 ` [PATCH v2 6/8] of/irq: Use the msi-map property to provide device-specific MSI domain Marc Zyngier
2015-10-06 17:04   ` Marc Zyngier
2015-10-06 17:04 ` [PATCH v2 7/8] PCI: Add per-device MSI domain hook Marc Zyngier
2015-10-06 17:04   ` Marc Zyngier
2015-10-15 20:11   ` Bjorn Helgaas
2015-10-15 20:11     ` Bjorn Helgaas
2015-10-06 17:04 ` [PATCH v2 8/8] PCI/MSI: Allow the MSI domain to be device-specific Marc Zyngier
2015-10-06 17:04   ` Marc Zyngier
2015-10-15 20:11   ` Bjorn Helgaas
2015-10-15 20:11     ` Bjorn Helgaas
2015-10-15 20:39 ` [PATCH v2 0/8] of: Handle multi-parent version of msi-parent & msi-map Rob Herring
2015-10-15 20:39   ` Rob Herring

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=20151015201050.GC10442@localhost \
    --to=helgaas@kernel.org \
    --cc=Mark.Rutland@arm.com \
    --cc=bhelgaas@google.com \
    --cc=ddaney.cavm@gmail.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=tglx@linutronix.de \
    /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.