Commit 92b4f9d1 authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Martin K. Petersen

scsi: megaraid_sas: fixup MSIx interrupt setup during resume

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.deSigned-off-by: default avatarHannes Reinecke <hare@suse.de>
Acked-by: default avatarSumit Saxena <sumit.saxena@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 00fe717e
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment