Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1190908

Re: [PATCH v5 05/19] PCI/MSI: of: Add support for OF-provided msi_domain

From Bjorn Helgaas <bhelgaas@google.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 05/19] PCI/MSI: of: Add support for OF-provided msi_domain
Date 2015-07-23 15:20 +0200
Message-ID <pPozL-7MD-3@gated-at.bofh.it> (permalink)
References <pPkZb-2zd-5@gated-at.bofh.it> <pPkZc-2zd-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Jul 23, 2015 at 10:26:24AM +0100, Marc Zyngier wrote:
> In order to populate the PCI host bridge msi_domain, use the
> "msi-parent" attribute to lookup a corresponding irq domain.
> If found, this is our MSI domain.
> 
> This gets plugged into the core PCI code.
> 
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>

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

> +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;
> +	np = of_parse_phandle(bus->dev.of_node, "msi-parent", 0);
> +	if (!np)
> +		return NULL;
> +	d = irq_find_matching_host(np, DOMAIN_BUS_PCI_MSI);
> +	if (!d)
> +		d = irq_find_host(np);
> +	return d;

    d = irq_find_matching_host(np, DOMAIN_BUS_PCI_MSI);
    if (d)
	    return d;

    return irq_find_host(np);

> +#else
> +	return NULL;
> +#endif

>  static struct irq_domain *pci_host_bridge_msi_domain(struct pci_bus *bus)
>  {
> +	struct irq_domain *d;
> +
>  	/*
>  	 * Any firmware interface that can resolve the msi_domain
>  	 * should be called from here.
>  	 */
> +	d = pci_host_bridge_of_msi_domain(bus);
>  
> -	return NULL;
> +	return d;

No temporary needed (until there's another firmware interface):

    return pci_host_bridge_of_msi_domain(bus);
--
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/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH v5 05/19] PCI/MSI: of: Add support for OF-provided  msi_domain Bjorn Helgaas <bhelgaas@google.com> - 2015-07-23 15:20 +0200

csiph-web