Skip to content

Commit be2021b

Browse files
nowicki-tomaszMarc Zyngier
authored andcommitted
PCI/MSI: Setup MSI domain on a per-device basis using IORT ACPI table
It is possible to provide information about which MSI controller to use on a per-device basis for DT. This patch supply this with ACPI support. Currently, IORT is the only one ACPI table which can provide such mapping. In order to plug IORT into MSI infrastructure we are adding ACPI equivalents for finding PCI device domain and its RID translation (pci_msi_domain_get_msi_rid and pci_msi_domain_get_msi_rid calls). Signed-off-by: Tomasz Nowicki <tn@semihalf.com> Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org> Acked-by: Marc Zyngier <marc.zyngier@arm.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
1 parent 4bf2efd commit be2021b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/pci/msi.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/smp.h>
2020
#include <linux/errno.h>
2121
#include <linux/io.h>
22+
#include <linux/acpi_iort.h>
2223
#include <linux/slab.h>
2324
#include <linux/irqdomain.h>
2425
#include <linux/of_irq.h>
@@ -1502,8 +1503,8 @@ u32 pci_msi_domain_get_msi_rid(struct irq_domain *domain, struct pci_dev *pdev)
15021503
pci_for_each_dma_alias(pdev, get_msi_id_cb, &rid);
15031504

15041505
of_node = irq_domain_get_of_node(domain);
1505-
if (of_node)
1506-
rid = of_msi_map_rid(&pdev->dev, of_node, rid);
1506+
rid = of_node ? of_msi_map_rid(&pdev->dev, of_node, rid) :
1507+
iort_msi_map_rid(&pdev->dev, rid);
15071508

15081509
return rid;
15091510
}
@@ -1519,9 +1520,13 @@ u32 pci_msi_domain_get_msi_rid(struct irq_domain *domain, struct pci_dev *pdev)
15191520
*/
15201521
struct irq_domain *pci_msi_get_device_domain(struct pci_dev *pdev)
15211522
{
1523+
struct irq_domain *dom;
15221524
u32 rid = 0;
15231525

15241526
pci_for_each_dma_alias(pdev, get_msi_id_cb, &rid);
1525-
return of_msi_map_get_device_domain(&pdev->dev, rid);
1527+
dom = of_msi_map_get_device_domain(&pdev->dev, rid);
1528+
if (!dom)
1529+
dom = iort_get_device_domain(&pdev->dev, rid);
1530+
return dom;
15261531
}
15271532
#endif /* CONFIG_PCI_MSI_IRQ_DOMAIN */

0 commit comments

Comments
 (0)