Skip to content

Commit c822392

Browse files
nxpfranklibjorn-helgaas
authored andcommitted
PCI: endpoint: pci-ep-msi: Add checks for MSI parent and mutability
Some MSI controllers can change address/data pair during the execution of irq_chip::irq_set_affinity() callback. Since the current PCI Endpoint framework cannot support mutable MSI controllers, call irq_domain_is_msi_immutable() API to check if the controller is immutable or not. Also ensure that the MSI domain is a parent MSI domain so that it can allocate address/data pairs. Signed-off-by: Frank Li <Frank.Li@nxp.com> [mani: reworded error message and commit message] Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Tested-by: Niklas Cassel <cassel@kernel.org> Link: https://patch.msgid.link/20250710-ep-msi-v21-4-57683fc7fb25@nxp.com
1 parent 1c3b002 commit c822392

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

drivers/pci/endpoint/pci-ep-msi.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ int pci_epf_alloc_doorbell(struct pci_epf *epf, u16 num_db)
5757
return -ENODEV;
5858
}
5959

60+
if (!irq_domain_is_msi_parent(domain))
61+
return -ENODEV;
62+
63+
if (!irq_domain_is_msi_immutable(domain)) {
64+
dev_err(dev, "Mutable MSI controller not supported\n");
65+
return -ENODEV;
66+
}
67+
6068
dev_set_msi_domain(epc->dev.parent, domain);
6169

6270
msg = kcalloc(num_db, sizeof(struct pci_epf_doorbell_msg), GFP_KERNEL);

0 commit comments

Comments
 (0)