Thread (6 messages) flat view 6 messages, 4 authors, 2016-08-30

[PATCH 2/3] pci: pcie-designware: add support for external MSI controller

From: andrew@lunn.ch (Andrew Lunn)
Date: 2016-08-30 13:11:31
Also in: linux-devicetree, linux-pci

On Tue, Aug 30, 2016 at 02:57:09PM +0200, Thomas Petazzoni wrote:
The Designware PCIe controllers have a built-in MSI controller, which is
already supported by the existing. However, in some situations, it might
                                   ^ driver.
be a better choice to use an external MSI controller, especially when it
provides a higher number of MSI interrupts than the built-in one.

Therefore, this commit extends the pcie-designware driver to support the
"msi-parent" DT property, already used by other drivers. It contains a
phandle pointing to the external MSI controller to be used.

Following this commit, the pcie-designware code supports three
possibilities, in this order:

 1. If msi-parent is provided, then the MSI controller pointed by this
                                                                 ^ to  
    property is used.
 	if (IS_ENABLED(CONFIG_PCI_MSI)) {
-		if (!pp->ops->msi_host_init) {
+		if (of_find_property(pp->dev->of_node, "msi-parent", NULL)) {
+			struct device_node *msi_node;
+
+			msi_node = of_parse_phandle(pp->dev->of_node,
+						    "msi-parent", 0);
+			if (!msi_node)
+				return -ENODEV;
+
+			msi = of_pci_find_msi_chip_by_node(msi_node);
By this point, device tree tells us the external MSI controller
should exist. So if we get a NULL here, should we not return
-EPROBE_DIFFERED?

	Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help