Skip to contentSkip to conversation

IB/qib: Use PCI_IRQ_MSI_TYPES where appropriate

PATCH Applied Piotr Stankiewicz 2 participants 3 messages Jun 2, 2020 InfiniBand

v1 of 4 Applied Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 8/15 IB/qib: Use PCI_IRQ_MSI_TYPES where appropriate

Seeing as there is shorthand available to use when asking for any type of interrupt, or any type of message signalled interrupt, leverage it.

---
 drivers/infiniband/hw/qib/qib_pcie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/qib/qib_pcie.c +1 -1
index 3dc6ce033319..3e22dd274fb3 100644
@@ -213,7 +213,7 @@ int qib_pcie_params(struct qib_devdata *dd, u32 minw, u32 *nent)
 	u16 linkstat, speed;
 	int nvec;
 	int maxvec;
-	unsigned int flags = PCI_IRQ_MSIX | PCI_IRQ_MSI;
+	unsigned int flags = PCI_IRQ_MSI_TYPES;
 
 	if (!pci_is_pcie(dd->pcidev)) {
 		qib_dev_err(dd, "Can't find PCI Express capability!\n");
Signature · 1 line
2.17.2
#1 lore raw
Quoted 3 lines · Piotr Stankiewicz

Seeing as there is shorthand available to use when asking for any type of interrupt, or any type of message signalled interrupt, leverage it.

...

drivers/infiniband/hw/qib/qib_pcie.c int qib_pcie_params(struct qib_devdata *dd, u32 minw, u32 *nent) · line 219

Quoted 5 lines
drivers/infiniband/hw/qib/qib_pcie.c +1 -1
-       unsigned int flags = PCI_IRQ_MSIX | PCI_IRQ_MSI;
+       unsigned int flags = PCI_IRQ_MSI_TYPES;
 
        if (!pci_is_pcie(dd->pcidev)) {
                qib_dev_err(dd, "Can't find PCI Express capability!\n");

Internally I have proposed at last this:

convert the following

        if (dd->flags & QIB_HAS_INTX)
               flags |= PCI_IRQ_LEGACY;

to

        if (dd->flags & QIB_HAS_INTX)
               flags = PCI_IRQ_ALL_TYPES;
        if (dd->flags & QIB_HAS_INTX)
               flags = PCI_IRQ_MSI_TYPES;
Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
Quoted 2 lines · Andy Shevchenko

On Tue, Jun 2, 2020 at 12:25 PM Piotr Stankiewicz
<[email protected]> wrote:

...

Quoted 4 lines
        if (dd->flags & QIB_HAS_INTX)
               flags = PCI_IRQ_ALL_TYPES;

        if (dd->flags & QIB_HAS_INTX)

This line should be 'else'.

Quoted 1 line
               flags = PCI_IRQ_MSI_TYPES;
Signature · 2 lines
With Best Regards,
Andy Shevchenko