diff options
-rw-r--r-- | drivers/scsi/bfa/bfad.c | 62 | ||||
-rw-r--r-- | drivers/scsi/fnic/fnic_isr.c | 4 | ||||
-rw-r--r-- | drivers/scsi/isci/init.c | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 9 | ||||
-rw-r--r-- | drivers/scsi/pm8001/pm8001_init.c | 5 | ||||
-rw-r--r-- | drivers/scsi/vmw_pvscsi.c | 2 |
6 files changed, 38 insertions, 46 deletions
diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index 7593b7c1d336..e90a3742f09d 100644 --- a/drivers/scsi/bfa/bfad.c +++ b/drivers/scsi/bfa/bfad.c | |||
@@ -1219,7 +1219,7 @@ bfad_install_msix_handler(struct bfad_s *bfad) | |||
1219 | int | 1219 | int |
1220 | bfad_setup_intr(struct bfad_s *bfad) | 1220 | bfad_setup_intr(struct bfad_s *bfad) |
1221 | { | 1221 | { |
1222 | int error = 0; | 1222 | int error; |
1223 | u32 mask = 0, i, num_bit = 0, max_bit = 0; | 1223 | u32 mask = 0, i, num_bit = 0, max_bit = 0; |
1224 | struct msix_entry msix_entries[MAX_MSIX_ENTRY]; | 1224 | struct msix_entry msix_entries[MAX_MSIX_ENTRY]; |
1225 | struct pci_dev *pdev = bfad->pcidev; | 1225 | struct pci_dev *pdev = bfad->pcidev; |
@@ -1234,34 +1234,24 @@ bfad_setup_intr(struct bfad_s *bfad) | |||
1234 | if ((bfa_asic_id_ctc(pdev->device) && !msix_disable_ct) || | 1234 | if ((bfa_asic_id_ctc(pdev->device) && !msix_disable_ct) || |
1235 | (bfa_asic_id_cb(pdev->device) && !msix_disable_cb)) { | 1235 | (bfa_asic_id_cb(pdev->device) && !msix_disable_cb)) { |
1236 | 1236 | ||
1237 | error = pci_enable_msix(bfad->pcidev, msix_entries, bfad->nvec); | 1237 | error = pci_enable_msix_exact(bfad->pcidev, |
1238 | if (error) { | 1238 | msix_entries, bfad->nvec); |
1239 | /* In CT1 & CT2, try to allocate just one vector */ | 1239 | /* In CT1 & CT2, try to allocate just one vector */ |
1240 | if (bfa_asic_id_ctc(pdev->device)) { | 1240 | if (error == -ENOSPC && bfa_asic_id_ctc(pdev->device)) { |
1241 | printk(KERN_WARNING "bfa %s: trying one msix " | 1241 | printk(KERN_WARNING "bfa %s: trying one msix " |
1242 | "vector failed to allocate %d[%d]\n", | 1242 | "vector failed to allocate %d[%d]\n", |
1243 | bfad->pci_name, bfad->nvec, error); | 1243 | bfad->pci_name, bfad->nvec, error); |
1244 | bfad->nvec = 1; | 1244 | bfad->nvec = 1; |
1245 | error = pci_enable_msix(bfad->pcidev, | 1245 | error = pci_enable_msix_exact(bfad->pcidev, |
1246 | msix_entries, bfad->nvec); | 1246 | msix_entries, 1); |
1247 | } | 1247 | } |
1248 | 1248 | ||
1249 | /* | 1249 | if (error) { |
1250 | * Only error number of vector is available. | 1250 | printk(KERN_WARNING "bfad%d: " |
1251 | * We don't have a mechanism to map multiple | 1251 | "pci_enable_msix_exact failed (%d), " |
1252 | * interrupts into one vector, so even if we | 1252 | "use line based.\n", |
1253 | * can try to request less vectors, we don't | 1253 | bfad->inst_no, error); |
1254 | * know how to associate interrupt events to | 1254 | goto line_based; |
1255 | * vectors. Linux doesn't duplicate vectors | ||
1256 | * in the MSIX table for this case. | ||
1257 | */ | ||
1258 | if (error) { | ||
1259 | printk(KERN_WARNING "bfad%d: " | ||
1260 | "pci_enable_msix failed (%d), " | ||
1261 | "use line based.\n", | ||
1262 | bfad->inst_no, error); | ||
1263 | goto line_based; | ||
1264 | } | ||
1265 | } | 1255 | } |
1266 | 1256 | ||
1267 | /* Disable INTX in MSI-X mode */ | 1257 | /* Disable INTX in MSI-X mode */ |
@@ -1281,20 +1271,18 @@ bfad_setup_intr(struct bfad_s *bfad) | |||
1281 | 1271 | ||
1282 | bfad->bfad_flags |= BFAD_MSIX_ON; | 1272 | bfad->bfad_flags |= BFAD_MSIX_ON; |
1283 | 1273 | ||
1284 | return error; | 1274 | return 0; |
1285 | } | 1275 | } |
1286 | 1276 | ||
1287 | line_based: | 1277 | line_based: |
1288 | error = 0; | 1278 | error = request_irq(bfad->pcidev->irq, (irq_handler_t)bfad_intx, |
1289 | if (request_irq | 1279 | BFAD_IRQ_FLAGS, BFAD_DRIVER_NAME, bfad); |
1290 | (bfad->pcidev->irq, (irq_handler_t) bfad_intx, BFAD_IRQ_FLAGS, | 1280 | if (error) |
1291 | BFAD_DRIVER_NAME, bfad) != 0) { | 1281 | return error; |
1292 | /* Enable interrupt handler failed */ | 1282 | |
1293 | return 1; | ||
1294 | } | ||
1295 | bfad->bfad_flags |= BFAD_INTX_ON; | 1283 | bfad->bfad_flags |= BFAD_INTX_ON; |
1296 | 1284 | ||
1297 | return error; | 1285 | return 0; |
1298 | } | 1286 | } |
1299 | 1287 | ||
1300 | void | 1288 | void |
diff --git a/drivers/scsi/fnic/fnic_isr.c b/drivers/scsi/fnic/fnic_isr.c index 7d9b54ae7f62..a0dd1b67a467 100644 --- a/drivers/scsi/fnic/fnic_isr.c +++ b/drivers/scsi/fnic/fnic_isr.c | |||
@@ -257,8 +257,8 @@ int fnic_set_intr_mode(struct fnic *fnic) | |||
257 | fnic->raw_wq_count >= m && | 257 | fnic->raw_wq_count >= m && |
258 | fnic->wq_copy_count >= o && | 258 | fnic->wq_copy_count >= o && |
259 | fnic->cq_count >= n + m + o) { | 259 | fnic->cq_count >= n + m + o) { |
260 | if (!pci_enable_msix(fnic->pdev, fnic->msix_entry, | 260 | if (!pci_enable_msix_exact(fnic->pdev, fnic->msix_entry, |
261 | n + m + o + 1)) { | 261 | n + m + o + 1)) { |
262 | fnic->rq_count = n; | 262 | fnic->rq_count = n; |
263 | fnic->raw_wq_count = m; | 263 | fnic->raw_wq_count = m; |
264 | fnic->wq_copy_count = o; | 264 | fnic->wq_copy_count = o; |
diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c index 695b34e9154e..4198e45ea941 100644 --- a/drivers/scsi/isci/init.c +++ b/drivers/scsi/isci/init.c | |||
@@ -356,7 +356,7 @@ static int isci_setup_interrupts(struct pci_dev *pdev) | |||
356 | for (i = 0; i < num_msix; i++) | 356 | for (i = 0; i < num_msix; i++) |
357 | pci_info->msix_entries[i].entry = i; | 357 | pci_info->msix_entries[i].entry = i; |
358 | 358 | ||
359 | err = pci_enable_msix(pdev, pci_info->msix_entries, num_msix); | 359 | err = pci_enable_msix_exact(pdev, pci_info->msix_entries, num_msix); |
360 | if (err) | 360 | if (err) |
361 | goto intx; | 361 | goto intx; |
362 | 362 | ||
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 06f9a5b79e66..a5769a9960ac 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -8242,7 +8242,7 @@ lpfc_sli_enable_msix(struct lpfc_hba *phba) | |||
8242 | if (rc) { | 8242 | if (rc) { |
8243 | lpfc_printf_log(phba, KERN_INFO, LOG_INIT, | 8243 | lpfc_printf_log(phba, KERN_INFO, LOG_INIT, |
8244 | "0420 PCI enable MSI-X failed (%d)\n", rc); | 8244 | "0420 PCI enable MSI-X failed (%d)\n", rc); |
8245 | goto msi_fail_out; | 8245 | goto vec_fail_out; |
8246 | } | 8246 | } |
8247 | for (i = 0; i < LPFC_MSIX_VECTORS; i++) | 8247 | for (i = 0; i < LPFC_MSIX_VECTORS; i++) |
8248 | lpfc_printf_log(phba, KERN_INFO, LOG_INIT, | 8248 | lpfc_printf_log(phba, KERN_INFO, LOG_INIT, |
@@ -8320,6 +8320,8 @@ irq_fail_out: | |||
8320 | msi_fail_out: | 8320 | msi_fail_out: |
8321 | /* Unconfigure MSI-X capability structure */ | 8321 | /* Unconfigure MSI-X capability structure */ |
8322 | pci_disable_msix(phba->pcidev); | 8322 | pci_disable_msix(phba->pcidev); |
8323 | |||
8324 | vec_fail_out: | ||
8323 | return rc; | 8325 | return rc; |
8324 | } | 8326 | } |
8325 | 8327 | ||
@@ -8812,7 +8814,7 @@ enable_msix_vectors: | |||
8812 | } else if (rc) { | 8814 | } else if (rc) { |
8813 | lpfc_printf_log(phba, KERN_INFO, LOG_INIT, | 8815 | lpfc_printf_log(phba, KERN_INFO, LOG_INIT, |
8814 | "0484 PCI enable MSI-X failed (%d)\n", rc); | 8816 | "0484 PCI enable MSI-X failed (%d)\n", rc); |
8815 | goto msi_fail_out; | 8817 | goto vec_fail_out; |
8816 | } | 8818 | } |
8817 | 8819 | ||
8818 | /* Log MSI-X vector assignment */ | 8820 | /* Log MSI-X vector assignment */ |
@@ -8875,9 +8877,10 @@ cfg_fail_out: | |||
8875 | &phba->sli4_hba.fcp_eq_hdl[index]); | 8877 | &phba->sli4_hba.fcp_eq_hdl[index]); |
8876 | } | 8878 | } |
8877 | 8879 | ||
8878 | msi_fail_out: | ||
8879 | /* Unconfigure MSI-X capability structure */ | 8880 | /* Unconfigure MSI-X capability structure */ |
8880 | pci_disable_msix(phba->pcidev); | 8881 | pci_disable_msix(phba->pcidev); |
8882 | |||
8883 | vec_fail_out: | ||
8881 | return rc; | 8884 | return rc; |
8882 | } | 8885 | } |
8883 | 8886 | ||
diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c index 236fba40e540..e49623a897a7 100644 --- a/drivers/scsi/pm8001/pm8001_init.c +++ b/drivers/scsi/pm8001/pm8001_init.c | |||
@@ -763,9 +763,10 @@ static u32 pm8001_setup_msix(struct pm8001_hba_info *pm8001_ha) | |||
763 | pm8001_ha->irq_vector[i].irq_id = i; | 763 | pm8001_ha->irq_vector[i].irq_id = i; |
764 | pm8001_ha->irq_vector[i].drv_inst = pm8001_ha; | 764 | pm8001_ha->irq_vector[i].drv_inst = pm8001_ha; |
765 | 765 | ||
766 | if (request_irq(pm8001_ha->msix_entries[i].vector, | 766 | rc = request_irq(pm8001_ha->msix_entries[i].vector, |
767 | pm8001_interrupt_handler_msix, flag, | 767 | pm8001_interrupt_handler_msix, flag, |
768 | intr_drvname[i], &(pm8001_ha->irq_vector[i]))) { | 768 | intr_drvname[i], &(pm8001_ha->irq_vector[i])); |
769 | if (rc) { | ||
769 | for (j = 0; j < i; j++) | 770 | for (j = 0; j < i; j++) |
770 | free_irq( | 771 | free_irq( |
771 | pm8001_ha->msix_entries[j].vector, | 772 | pm8001_ha->msix_entries[j].vector, |
diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c index c88e1468aad7..598f65efaaec 100644 --- a/drivers/scsi/vmw_pvscsi.c +++ b/drivers/scsi/vmw_pvscsi.c | |||
@@ -1194,7 +1194,7 @@ static int pvscsi_setup_msix(const struct pvscsi_adapter *adapter, | |||
1194 | struct msix_entry entry = { 0, PVSCSI_VECTOR_COMPLETION }; | 1194 | struct msix_entry entry = { 0, PVSCSI_VECTOR_COMPLETION }; |
1195 | int ret; | 1195 | int ret; |
1196 | 1196 | ||
1197 | ret = pci_enable_msix(adapter->dev, &entry, 1); | 1197 | ret = pci_enable_msix_exact(adapter->dev, &entry, 1); |
1198 | if (ret) | 1198 | if (ret) |
1199 | return ret; | 1199 | return ret; |
1200 | 1200 | ||