]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
scsi: megaraid_sas: fixup MSIx interrupt setup during resume
authorHannes Reinecke <hare@suse.de>
Mon, 13 Jan 2020 13:26:09 +0000 (14:26 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 30 Jan 2020 15:31:47 +0000 (10:31 -0500)
Streamline resume workflow by using the same functions for enabling MSIx
interrupts as used during initialisation.  Without it the driver might
crash during resume with:

WARNING: CPU: 2 PID: 4306 at ../drivers/pci/msi.c:1303 pci_irq_get_affinity+0x3b/0x90

Link: https://lore.kernel.org/r/20200113132609.69536-1-hare@suse.de
Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Sumit Saxena <sumit.saxena@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/megaraid/megaraid_sas_base.c

index 43cbc749f66cc35877165657fccd7c0149013277..07a33fdf231693a34ab0744fbcec9e58b0b37911 100644 (file)
@@ -7604,7 +7604,6 @@ megasas_resume(struct pci_dev *pdev)
        int rval;
        struct Scsi_Host *host;
        struct megasas_instance *instance;
-       int irq_flags = PCI_IRQ_LEGACY;
        u32 status_reg;
 
        instance = pci_get_drvdata(pdev);
@@ -7673,16 +7672,15 @@ megasas_resume(struct pci_dev *pdev)
        atomic_set(&instance->ldio_outstanding, 0);
 
        /* Now re-enable MSI-X */
-       if (instance->msix_vectors) {
-               irq_flags = PCI_IRQ_MSIX;
-               if (instance->smp_affinity_enable)
-                       irq_flags |= PCI_IRQ_AFFINITY;
-       }
-       rval = pci_alloc_irq_vectors(instance->pdev, 1,
-                                    instance->msix_vectors ?
-                                    instance->msix_vectors : 1, irq_flags);
-       if (rval < 0)
-               goto fail_reenable_msix;
+       if (instance->msix_vectors)
+               megasas_alloc_irq_vectors(instance);
+
+       if (!instance->msix_vectors) {
+               rval = pci_alloc_irq_vectors(instance->pdev, 1, 1,
+                                            PCI_IRQ_LEGACY);
+               if (rval < 0)
+                       goto fail_reenable_msix;
+       }
 
        megasas_setup_reply_map(instance);