diff options
Diffstat (limited to 'drivers/message/fusion')
-rw-r--r-- | drivers/message/fusion/mptbase.c | 17 | ||||
-rw-r--r-- | drivers/message/fusion/mptbase.h | 1 |
2 files changed, 13 insertions, 5 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index c6be6eba7dc3..6ee5876d0524 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -79,7 +79,7 @@ MODULE_VERSION(my_VERSION); | |||
79 | /* | 79 | /* |
80 | * cmd line parameters | 80 | * cmd line parameters |
81 | */ | 81 | */ |
82 | static int mpt_msi_enable; | 82 | static int mpt_msi_enable = -1; |
83 | module_param(mpt_msi_enable, int, 0); | 83 | module_param(mpt_msi_enable, int, 0); |
84 | MODULE_PARM_DESC(mpt_msi_enable, " MSI Support Enable (default=0)"); | 84 | MODULE_PARM_DESC(mpt_msi_enable, " MSI Support Enable (default=0)"); |
85 | 85 | ||
@@ -1686,6 +1686,11 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1686 | ioc->bus_type = SAS; | 1686 | ioc->bus_type = SAS; |
1687 | } | 1687 | } |
1688 | 1688 | ||
1689 | if (ioc->bus_type == SAS && mpt_msi_enable == -1) | ||
1690 | ioc->msi_enable = 1; | ||
1691 | else | ||
1692 | ioc->msi_enable = mpt_msi_enable; | ||
1693 | |||
1689 | if (ioc->errata_flag_1064) | 1694 | if (ioc->errata_flag_1064) |
1690 | pci_disable_io_access(pdev); | 1695 | pci_disable_io_access(pdev); |
1691 | 1696 | ||
@@ -2057,15 +2062,17 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
2057 | if ((ret == 0) && (reason == MPT_HOSTEVENT_IOC_BRINGUP)) { | 2062 | if ((ret == 0) && (reason == MPT_HOSTEVENT_IOC_BRINGUP)) { |
2058 | ioc->pci_irq = -1; | 2063 | ioc->pci_irq = -1; |
2059 | if (ioc->pcidev->irq) { | 2064 | if (ioc->pcidev->irq) { |
2060 | if (mpt_msi_enable && !pci_enable_msi(ioc->pcidev)) | 2065 | if (ioc->msi_enable && !pci_enable_msi(ioc->pcidev)) |
2061 | printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n", | 2066 | printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n", |
2062 | ioc->name); | 2067 | ioc->name); |
2068 | else | ||
2069 | ioc->msi_enable = 0; | ||
2063 | rc = request_irq(ioc->pcidev->irq, mpt_interrupt, | 2070 | rc = request_irq(ioc->pcidev->irq, mpt_interrupt, |
2064 | IRQF_SHARED, ioc->name, ioc); | 2071 | IRQF_SHARED, ioc->name, ioc); |
2065 | if (rc < 0) { | 2072 | if (rc < 0) { |
2066 | printk(MYIOC_s_ERR_FMT "Unable to allocate " | 2073 | printk(MYIOC_s_ERR_FMT "Unable to allocate " |
2067 | "interrupt %d!\n", ioc->name, ioc->pcidev->irq); | 2074 | "interrupt %d!\n", ioc->name, ioc->pcidev->irq); |
2068 | if (mpt_msi_enable) | 2075 | if (ioc->msi_enable) |
2069 | pci_disable_msi(ioc->pcidev); | 2076 | pci_disable_msi(ioc->pcidev); |
2070 | return -EBUSY; | 2077 | return -EBUSY; |
2071 | } | 2078 | } |
@@ -2261,7 +2268,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
2261 | out: | 2268 | out: |
2262 | if ((ret != 0) && irq_allocated) { | 2269 | if ((ret != 0) && irq_allocated) { |
2263 | free_irq(ioc->pci_irq, ioc); | 2270 | free_irq(ioc->pci_irq, ioc); |
2264 | if (mpt_msi_enable) | 2271 | if (ioc->msi_enable) |
2265 | pci_disable_msi(ioc->pcidev); | 2272 | pci_disable_msi(ioc->pcidev); |
2266 | } | 2273 | } |
2267 | return ret; | 2274 | return ret; |
@@ -2443,7 +2450,7 @@ mpt_adapter_dispose(MPT_ADAPTER *ioc) | |||
2443 | 2450 | ||
2444 | if (ioc->pci_irq != -1) { | 2451 | if (ioc->pci_irq != -1) { |
2445 | free_irq(ioc->pci_irq, ioc); | 2452 | free_irq(ioc->pci_irq, ioc); |
2446 | if (mpt_msi_enable) | 2453 | if (ioc->msi_enable) |
2447 | pci_disable_msi(ioc->pcidev); | 2454 | pci_disable_msi(ioc->pcidev); |
2448 | ioc->pci_irq = -1; | 2455 | ioc->pci_irq = -1; |
2449 | } | 2456 | } |
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h index caadc68c3000..50c0c173e24e 100644 --- a/drivers/message/fusion/mptbase.h +++ b/drivers/message/fusion/mptbase.h | |||
@@ -630,6 +630,7 @@ typedef struct _MPT_ADAPTER | |||
630 | int mtrr_reg; | 630 | int mtrr_reg; |
631 | struct pci_dev *pcidev; /* struct pci_dev pointer */ | 631 | struct pci_dev *pcidev; /* struct pci_dev pointer */ |
632 | int bars; /* bitmask of BAR's that must be configured */ | 632 | int bars; /* bitmask of BAR's that must be configured */ |
633 | int msi_enable; | ||
633 | u8 __iomem *memmap; /* mmap address */ | 634 | u8 __iomem *memmap; /* mmap address */ |
634 | struct Scsi_Host *sh; /* Scsi Host pointer */ | 635 | struct Scsi_Host *sh; /* Scsi Host pointer */ |
635 | SpiCfgData spi_data; /* Scsi config. data */ | 636 | SpiCfgData spi_data; /* Scsi config. data */ |