Re: [PATCH V3] PCI: exynos: add support for MSI
From: Jingoo Han <hidden>
Date: 2013-10-09 05:07:50
Also in:
linux-pci, linux-samsung-soc, lkml
On Tuesday, October 08, 2013 3:23 PM, Kishon Vijay Abraham I wrote:
On Friday 06 September 2013 12:24 PM, Jingoo Han wrote:quoted
This patch adds support for Message Signaled Interrupt in the Exynos PCIe diver using Synopsys designware PCIe core IP. Signed-off-by: Siva Reddy Kallam <redacted> Signed-off-by: Srikanth T Shivanand <redacted> Signed-off-by: Jingoo Han <redacted> Cc: Pratyush Anand <redacted> Cc: Mohit KUMAR <redacted> ---
[.....]
quoted
int __init dw_pcie_host_init(struct pcie_port *pp) { struct device_node *np = pp->dev->of_node;@@ -157,6 +372,8 @@ int __init dw_pcie_host_init(struct pcie_port *pp) struct of_pci_range_parser parser; u32 val; + struct irq_domain *irq_domain; + if (of_pci_range_parser_init(&parser, np)) { dev_err(pp->dev, "missing ranges property\n"); return -EINVAL;@@ -223,6 +440,18 @@ int __init dw_pcie_host_init(struct pcie_port *pp) return -EINVAL; } + if (IS_ENABLED(CONFIG_PCI_MSI)) { + irq_domain = irq_domain_add_linear(pp->dev->of_node, + MAX_MSI_IRQS, &msi_domain_ops, + &dw_pcie_msi_chip); + if (!irq_domain) { + dev_err(pp->dev, "irq domain init failed\n"); + return -ENXIO; + } + + pp->msi_irq_start = irq_find_mapping(irq_domain, 0);Where is the irq_create_mapping done for this irq domain? Is that not needed? Without that I'm not getting the correct irq number.
Oh, you're right. irq_create_mapping() is necessary! Without irq_create_mapping(), it makes the ugly NULL deference when two PCIe controllers are used on Exynos5440. It is my mistake. I will add irq_create_mapping() to dw_msi_setup_irq(), as tegra PCIe driver did. I will send the patch, soon. I really appreciate your comment. :-) Thank you. Best regards, Jingoo Han