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

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Frank Li and committed by
Bjorn Helgaas
c8223922 1c3b002c

+8
+8
drivers/pci/endpoint/pci-ep-msi.c
··· 57 57 return -ENODEV; 58 58 } 59 59 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 + 60 68 dev_set_msi_domain(epc->dev.parent, domain); 61 69 62 70 msg = kcalloc(num_db, sizeof(struct pci_epf_doorbell_msg), GFP_KERNEL);