Skip to content

Commit 2c3a6f6

Browse files
damien-lemoalChristoph Hellwig
authored andcommitted
nvmet: pci-epf: do not fall back to using INTX if not supported
Some endpoint PCIe controllers do not support raising legacy INTX interrupts. This support is indicated by the intx_capable field of struct pci_epc_features. Modify nvmet_pci_epf_raise_irq() to not automatically fallback to trying raising an INTX interrupt after an MSI or MSI-X error if the controller does not support INTX. Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent 85adf20 commit 2c3a6f6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/nvme/target/pci-epf.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -636,14 +636,16 @@ static void nvmet_pci_epf_raise_irq(struct nvmet_pci_epf_ctrl *ctrl,
636636
switch (nvme_epf->irq_type) {
637637
case PCI_IRQ_MSIX:
638638
case PCI_IRQ_MSI:
639+
/*
640+
* If we fail to raise an MSI or MSI-X interrupt, it is likely
641+
* because the host is using legacy INTX IRQs (e.g. BIOS,
642+
* grub), but we can fallback to the INTX type only if the
643+
* endpoint controller supports this type.
644+
*/
639645
ret = pci_epc_raise_irq(epf->epc, epf->func_no, epf->vfunc_no,
640646
nvme_epf->irq_type, cq->vector + 1);
641-
if (!ret)
647+
if (!ret || !nvme_epf->epc_features->intx_capable)
642648
break;
643-
/*
644-
* If we got an error, it is likely because the host is using
645-
* legacy IRQs (e.g. BIOS, grub).
646-
*/
647649
fallthrough;
648650
case PCI_IRQ_INTX:
649651
ret = pci_epc_raise_irq(epf->epc, epf->func_no, epf->vfunc_no,

0 commit comments

Comments
 (0)