PCI: use pci_intx_for_msi in pci_alloc_irq_vectors
RFC PATCH 1/1 PCI: use pci_intx_for_msi in pci_alloc_irq_vectors
Alex pointed out that we might want to use pci_intx_for_msi in pci_alloc_irq_vectors for the case where allocating MSI or MSI-X vectors fails completely. I tried to read up the history behind pci_intx_for_msi, but the changelogs seem a bit confusing, e.g. the comment in the tg3 around that code that was replaced by this quirk only talk about _disabling_ INT-X. Maybe someone can help me to shed some light about this workaround, and help answering the question wether we need it in this case.
--- drivers/pci/msi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/msi.c +1 -1
@@ -1215,7 +1215,7 @@ int pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,/* use legacy irq if allowed */ if ((flags &PCI_IRQ_LEGACY ) && min_vecs ==1 ) { -pci_intx (dev,1 ); +pci_intx_for_msi (dev,1 );return 1 ; }
Signature · 1 line
2.1.4
Hi Christoph,
Quoted 8 lines · Christoph Hellwig
Alex pointed out that we might want to use
pci_intx_for_msiinpci_alloc_irq_vectorsfor the case where allocating MSI or MSI-X vectors fails completely. I tried to read up the history behindpci_intx_for_msi, but the changelogs seem a bit confusing, e.g. the comment in the tg3 around that code that was replaced by this quirk only talk about _disabling_ INT-X. Maybe someone can help me to shed some light about this workaround, and help answering the question wether we need it in this case.
If we want to do this, I'd like to have a changelog that explains *why*, so I'm ignoring it for now. I'm not nacking it; I just don't understand why we should do it yet, and I'm too lazy to do all the research myself.
Quoted 27 lines
Signed-off-by Christoph Hellwig <[email protected]>Cc David Miller <[email protected]>Cc Shane Huang <[email protected]>--- drivers/pci/msi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pci/msi.c +1
-1@@ -1215,7 +1215,7 @@ int pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,/* use legacy irq if allowed */ if ((flags &PCI_IRQ_LEGACY ) && min_vecs ==1 ) { -pci_intx (dev,1 ); +pci_intx_for_msi (dev,1 );return 1 ; }Signature · 6 lines
2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines · Bjorn Helgaas
If we want to do this, I'd like to have a changelog that explains *why*, so I'm ignoring it for now. I'm not nacking it; I just don't understand why we should do it yet, and I'm too lazy to do all the research myself.
Can't blame you. Alex pointed me to the function, and it seems like a good idea, but research in git history just doesn't give me an conclusive reason on why to do it either.