Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

irqchip/gic-v3-its: Flag device allocation as proxied if behind a PCI bridge

An aliasing PCI bridge is another case where we should flag the
corresponding allocation as "proxied", as MSIs are coming with
the bridge's RID, and not the originating device's.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Tested-by: John Garry <john.garry@huawei.com>
Link: https://lore.kernel.org/r/20201129135208.680293-4-maz@kernel.org

+8 -3
+8 -3
drivers/irqchip/irq-gic-v3-its-pci-msi.c
··· 67 67 /* 68 68 * If pdev is downstream of any aliasing bridges, take an upper 69 69 * bound of how many other vectors could map to the same DevID. 70 + * Also tell the ITS that the signalling will come from a proxy 71 + * device, and that special allocation rules apply. 70 72 */ 71 73 pci_for_each_dma_alias(pdev, its_get_pci_alias, &alias_dev); 72 - if (alias_dev != pdev && alias_dev->subordinate) 73 - pci_walk_bus(alias_dev->subordinate, its_pci_msi_vec_count, 74 - &alias_count); 74 + if (alias_dev != pdev) { 75 + if (alias_dev->subordinate) 76 + pci_walk_bus(alias_dev->subordinate, 77 + its_pci_msi_vec_count, &alias_count); 78 + info->flags |= MSI_ALLOC_FLAGS_PROXY_DEVICE; 79 + } 75 80 76 81 /* ITS specific DeviceID, as the core ITS ignores dev. */ 77 82 info->scratchpad[0].ul = pci_msi_domain_get_msi_rid(domain, pdev);