linux-pci.vger.kernel.org archive mirror
 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 7/8] PCI: Add per-device MSI domain hook
Date: Thu, 15 Oct 2015 15:11:09 -0500	[thread overview]
Message-ID: <20151015201109.GD10442@localhost> (raw)
In-Reply-To: <1444151043-31084-8-git-send-email-marc.zyngier@arm.com>

On Tue, Oct 06, 2015 at 06:04:02PM +0100, Marc Zyngier wrote:
> So far, we have considered that the MSI domain for a device was
> either set via the architecture-dependent pcibios implementation
> or inherited from the host bridge.
> 
> As we're about to break that assumption, add pci_dev_msi_domain
> which is the equivalent of pci_host_bridge_msi_domain, but for
> a single device.
> 
> Other than moving things around a bit, this patch on its own
> has no effect.
> 
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>

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

> ---
>  drivers/pci/probe.c | 35 ++++++++++++++++++++++++++++++-----
>  1 file changed, 30 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 8361d27..7c333f8 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -1622,15 +1622,40 @@ static void pci_init_capabilities(struct pci_dev *dev)
>  	pci_enable_acs(dev);
>  }
>  
> +/*
> + * This is the equivalent of pci_host_bridge_msi_domain that acts on
> + * devices. Firmware interfaces that can select the MSI domain on a
> + * per-device basis should be called from here.
> + */
> +static struct irq_domain *pci_dev_msi_domain(struct pci_dev *dev)
> +{
> +	struct irq_domain *d;
> +
> +	/*
> +	 * If a domain has been set through the pcibios_add_device
> +	 * callback, then this is the one (platform code knows best).
> +	 */
> +	d = dev_get_msi_domain(&dev->dev);
> +	if (d)
> +		return d;
> +
> +	return NULL;
> +}
> +
>  static void pci_set_msi_domain(struct pci_dev *dev)
>  {
> +	struct irq_domain *d;
> +
>  	/*
> -	 * If no domain has been set through the pcibios_add_device
> -	 * callback, inherit the default from the bus device.
> +	 * If the platform or firmware interfaces cannot supply a
> +	 * device-specific MSI domain, then inherit the default domain
> +	 * from the host bridge itself.
>  	 */
> -	if (!dev_get_msi_domain(&dev->dev))
> -		dev_set_msi_domain(&dev->dev,
> -				   dev_get_msi_domain(&dev->bus->dev));
> +	d = pci_dev_msi_domain(dev);
> +	if (!d)
> +		d = dev_get_msi_domain(&dev->bus->dev);
> +
> +	dev_set_msi_domain(&dev->dev, d);
>  }
>  
>  void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
> -- 
> 2.1.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

Thread overview: 13+ 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 ` [PATCH v2 1/8] of/irq: Add support code for multi-parent version of "msi-parent" 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 ` [PATCH v2 3/8] PCI/MSI: " Marc Zyngier
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:04 ` [PATCH v2 5/8] of/irq: Split of_msi_map_rid to reuse msi-map lookup 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 ` [PATCH v2 7/8] PCI: Add per-device MSI domain hook Marc Zyngier
2015-10-15 20:11   ` Bjorn Helgaas [this message]
2015-10-06 17:04 ` [PATCH v2 8/8] PCI/MSI: Allow the MSI domain to be device-specific Marc Zyngier
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

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=20151015201109.GD10442@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).