James/Linux-scsi, This patch enables MSI-X before calling megasas_init_fw() in megaraid_sas. Signed-off-by: Adam Radford <aradford@xxxxxxxxx> diff -Naur linux-2.6.38-rc5/drivers/scsi/megaraid/megaraid_sas_base.c linux-2.6.38-rc5.new/drivers/scsi/megaraid/megaraid_sas_base.c --- linux-2.6.38-rc5/drivers/scsi/megaraid/megaraid_sas_base.c 2011-02-19 13:48:26.542364077 -0800 +++ linux-2.6.38-rc5.new/drivers/scsi/megaraid/megaraid_sas_base.c 2011-02-19 13:52:30.727362759 -0800 @@ -4039,12 +4039,6 @@ else INIT_WORK(&instance->work_init, process_fw_state_change_wq); - /* - * Initialize MFI Firmware - */ - if (megasas_init_fw(instance)) - goto fail_init_mfi; - /* Try to enable MSI-X */ if ((instance->pdev->device != PCI_DEVICE_ID_LSI_SAS1078R) && (instance->pdev->device != PCI_DEVICE_ID_LSI_SAS1078DE) && @@ -4054,6 +4048,12 @@ instance->msi_flag = 1; /* + * Initialize MFI Firmware + */ + if (megasas_init_fw(instance)) + goto fail_init_mfi; + + /* * Register IRQ */ if (request_irq(instance->msi_flag ? instance->msixentry.vector : @@ -4105,14 +4105,14 @@ instance->instancet->disable_intr(instance->reg_set); free_irq(instance->msi_flag ? instance->msixentry.vector : instance->pdev->irq, instance); +fail_irq: +fail_init_mfi: if (instance->msi_flag) pci_disable_msix(instance->pdev); if (instance->pdev->device == PCI_DEVICE_ID_LSI_FUSION) megasas_release_fusion(instance); else megasas_release_mfi(instance); - fail_irq: - fail_init_mfi: fail_alloc_dma_buf: if (instance->evt_detail) pci_free_consistent(pdev, sizeof(struct megasas_evt_detail), @@ -4296,6 +4296,10 @@ if (megasas_set_dma_mask(pdev)) goto fail_set_dma_mask; + /* Now re-enable MSI-X */ + if (instance->msi_flag) + pci_enable_msix(instance->pdev, &instance->msixentry, 1); + /* * Initialize MFI Firmware */ @@ -4332,10 +4336,6 @@ tasklet_init(&instance->isr_tasklet, instance->instancet->tasklet, (unsigned long)instance); - /* Now re-enable MSI-X */ - if (instance->msi_flag) - pci_enable_msix(instance->pdev, &instance->msixentry, 1); - /* * Register IRQ */
Attachment:
megaraid_sas.patch3
Description: Binary data