Commit 23a274c8 authored by Prakash, Sathya's avatar Prakash, Sathya Committed by James Bottomley

[SCSI] mpt fusion: Enable MSI by default for SAS controllers

This patch modifies the driver to enable MSI by default for all SAS chips.
Signed-off-by: default avatarSathya Prakash <sathya.prakash@lsi.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 74b2e047
...@@ -79,7 +79,7 @@ MODULE_VERSION(my_VERSION); ...@@ -79,7 +79,7 @@ MODULE_VERSION(my_VERSION);
/* /*
* cmd line parameters * cmd line parameters
*/ */
static int mpt_msi_enable; static int mpt_msi_enable = -1;
module_param(mpt_msi_enable, int, 0); module_param(mpt_msi_enable, int, 0);
MODULE_PARM_DESC(mpt_msi_enable, " MSI Support Enable (default=0)"); MODULE_PARM_DESC(mpt_msi_enable, " MSI Support Enable (default=0)");
...@@ -1686,6 +1686,11 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1686,6 +1686,11 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
ioc->bus_type = SAS; ioc->bus_type = SAS;
} }
if (ioc->bus_type == SAS && mpt_msi_enable == -1)
ioc->msi_enable = 1;
else
ioc->msi_enable = mpt_msi_enable;
if (ioc->errata_flag_1064) if (ioc->errata_flag_1064)
pci_disable_io_access(pdev); pci_disable_io_access(pdev);
...@@ -2057,15 +2062,17 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) ...@@ -2057,15 +2062,17 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
if ((ret == 0) && (reason == MPT_HOSTEVENT_IOC_BRINGUP)) { if ((ret == 0) && (reason == MPT_HOSTEVENT_IOC_BRINGUP)) {
ioc->pci_irq = -1; ioc->pci_irq = -1;
if (ioc->pcidev->irq) { if (ioc->pcidev->irq) {
if (mpt_msi_enable && !pci_enable_msi(ioc->pcidev)) if (ioc->msi_enable && !pci_enable_msi(ioc->pcidev))
printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n", printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n",
ioc->name); ioc->name);
else
ioc->msi_enable = 0;
rc = request_irq(ioc->pcidev->irq, mpt_interrupt, rc = request_irq(ioc->pcidev->irq, mpt_interrupt,
IRQF_SHARED, ioc->name, ioc); IRQF_SHARED, ioc->name, ioc);
if (rc < 0) { if (rc < 0) {
printk(MYIOC_s_ERR_FMT "Unable to allocate " printk(MYIOC_s_ERR_FMT "Unable to allocate "
"interrupt %d!\n", ioc->name, ioc->pcidev->irq); "interrupt %d!\n", ioc->name, ioc->pcidev->irq);
if (mpt_msi_enable) if (ioc->msi_enable)
pci_disable_msi(ioc->pcidev); pci_disable_msi(ioc->pcidev);
return -EBUSY; return -EBUSY;
} }
...@@ -2261,7 +2268,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) ...@@ -2261,7 +2268,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
out: out:
if ((ret != 0) && irq_allocated) { if ((ret != 0) && irq_allocated) {
free_irq(ioc->pci_irq, ioc); free_irq(ioc->pci_irq, ioc);
if (mpt_msi_enable) if (ioc->msi_enable)
pci_disable_msi(ioc->pcidev); pci_disable_msi(ioc->pcidev);
} }
return ret; return ret;
...@@ -2443,7 +2450,7 @@ mpt_adapter_dispose(MPT_ADAPTER *ioc) ...@@ -2443,7 +2450,7 @@ mpt_adapter_dispose(MPT_ADAPTER *ioc)
if (ioc->pci_irq != -1) { if (ioc->pci_irq != -1) {
free_irq(ioc->pci_irq, ioc); free_irq(ioc->pci_irq, ioc);
if (mpt_msi_enable) if (ioc->msi_enable)
pci_disable_msi(ioc->pcidev); pci_disable_msi(ioc->pcidev);
ioc->pci_irq = -1; ioc->pci_irq = -1;
} }
......
...@@ -630,6 +630,7 @@ typedef struct _MPT_ADAPTER ...@@ -630,6 +630,7 @@ typedef struct _MPT_ADAPTER
int mtrr_reg; int mtrr_reg;
struct pci_dev *pcidev; /* struct pci_dev pointer */ struct pci_dev *pcidev; /* struct pci_dev pointer */
int bars; /* bitmask of BAR's that must be configured */ int bars; /* bitmask of BAR's that must be configured */
int msi_enable;
u8 __iomem *memmap; /* mmap address */ u8 __iomem *memmap; /* mmap address */
struct Scsi_Host *sh; /* Scsi Host pointer */ struct Scsi_Host *sh; /* Scsi Host pointer */
SpiCfgData spi_data; /* Scsi config. data */ SpiCfgData spi_data; /* Scsi config. data */
......
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