diff options
Diffstat (limited to 'drivers/message/fusion/mptbase.c')
-rw-r--r-- | drivers/message/fusion/mptbase.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index c6be6eba7dc3..db3c892f87fb 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 | ||
@@ -1831,7 +1836,7 @@ mpt_suspend(struct pci_dev *pdev, pm_message_t state) | |||
1831 | CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); | 1836 | CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); |
1832 | 1837 | ||
1833 | free_irq(ioc->pci_irq, ioc); | 1838 | free_irq(ioc->pci_irq, ioc); |
1834 | if (mpt_msi_enable) | 1839 | if (ioc->msi_enable) |
1835 | pci_disable_msi(ioc->pcidev); | 1840 | pci_disable_msi(ioc->pcidev); |
1836 | ioc->pci_irq = -1; | 1841 | ioc->pci_irq = -1; |
1837 | pci_save_state(pdev); | 1842 | pci_save_state(pdev); |
@@ -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 | } |
@@ -2173,7 +2180,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
2173 | /* | 2180 | /* |
2174 | * Initalize link list for inactive raid volumes. | 2181 | * Initalize link list for inactive raid volumes. |
2175 | */ | 2182 | */ |
2176 | init_MUTEX(&ioc->raid_data.inactive_list_mutex); | 2183 | mutex_init(&ioc->raid_data.inactive_list_mutex); |
2177 | INIT_LIST_HEAD(&ioc->raid_data.inactive_list); | 2184 | INIT_LIST_HEAD(&ioc->raid_data.inactive_list); |
2178 | 2185 | ||
2179 | if (ioc->bus_type == SAS) { | 2186 | if (ioc->bus_type == SAS) { |
@@ -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 | } |
@@ -5159,13 +5166,13 @@ mpt_inactive_raid_list_free(MPT_ADAPTER *ioc) | |||
5159 | if (list_empty(&ioc->raid_data.inactive_list)) | 5166 | if (list_empty(&ioc->raid_data.inactive_list)) |
5160 | return; | 5167 | return; |
5161 | 5168 | ||
5162 | down(&ioc->raid_data.inactive_list_mutex); | 5169 | mutex_lock(&ioc->raid_data.inactive_list_mutex); |
5163 | list_for_each_entry_safe(component_info, pNext, | 5170 | list_for_each_entry_safe(component_info, pNext, |
5164 | &ioc->raid_data.inactive_list, list) { | 5171 | &ioc->raid_data.inactive_list, list) { |
5165 | list_del(&component_info->list); | 5172 | list_del(&component_info->list); |
5166 | kfree(component_info); | 5173 | kfree(component_info); |
5167 | } | 5174 | } |
5168 | up(&ioc->raid_data.inactive_list_mutex); | 5175 | mutex_unlock(&ioc->raid_data.inactive_list_mutex); |
5169 | } | 5176 | } |
5170 | 5177 | ||
5171 | /** | 5178 | /** |
@@ -5224,7 +5231,7 @@ mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id) | |||
5224 | if (!handle_inactive_volumes) | 5231 | if (!handle_inactive_volumes) |
5225 | goto out; | 5232 | goto out; |
5226 | 5233 | ||
5227 | down(&ioc->raid_data.inactive_list_mutex); | 5234 | mutex_lock(&ioc->raid_data.inactive_list_mutex); |
5228 | for (i = 0; i < buffer->NumPhysDisks; i++) { | 5235 | for (i = 0; i < buffer->NumPhysDisks; i++) { |
5229 | if(mpt_raid_phys_disk_pg0(ioc, | 5236 | if(mpt_raid_phys_disk_pg0(ioc, |
5230 | buffer->PhysDisk[i].PhysDiskNum, &phys_disk) != 0) | 5237 | buffer->PhysDisk[i].PhysDiskNum, &phys_disk) != 0) |
@@ -5244,7 +5251,7 @@ mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id) | |||
5244 | list_add_tail(&component_info->list, | 5251 | list_add_tail(&component_info->list, |
5245 | &ioc->raid_data.inactive_list); | 5252 | &ioc->raid_data.inactive_list); |
5246 | } | 5253 | } |
5247 | up(&ioc->raid_data.inactive_list_mutex); | 5254 | mutex_unlock(&ioc->raid_data.inactive_list_mutex); |
5248 | 5255 | ||
5249 | out: | 5256 | out: |
5250 | if (buffer) | 5257 | if (buffer) |