Commit a93cb871 authored by James Bottomley's avatar James Bottomley

Merge remote-tracking branch 'scsi-queue/drivers-for-3.17' into for-next

parents f9e06c69 db1924d0
...@@ -1219,7 +1219,7 @@ bfad_install_msix_handler(struct bfad_s *bfad) ...@@ -1219,7 +1219,7 @@ bfad_install_msix_handler(struct bfad_s *bfad)
int int
bfad_setup_intr(struct bfad_s *bfad) bfad_setup_intr(struct bfad_s *bfad)
{ {
int error = 0; int error;
u32 mask = 0, i, num_bit = 0, max_bit = 0; u32 mask = 0, i, num_bit = 0, max_bit = 0;
struct msix_entry msix_entries[MAX_MSIX_ENTRY]; struct msix_entry msix_entries[MAX_MSIX_ENTRY];
struct pci_dev *pdev = bfad->pcidev; struct pci_dev *pdev = bfad->pcidev;
...@@ -1234,34 +1234,24 @@ bfad_setup_intr(struct bfad_s *bfad) ...@@ -1234,34 +1234,24 @@ bfad_setup_intr(struct bfad_s *bfad)
if ((bfa_asic_id_ctc(pdev->device) && !msix_disable_ct) || if ((bfa_asic_id_ctc(pdev->device) && !msix_disable_ct) ||
(bfa_asic_id_cb(pdev->device) && !msix_disable_cb)) { (bfa_asic_id_cb(pdev->device) && !msix_disable_cb)) {
error = pci_enable_msix(bfad->pcidev, msix_entries, bfad->nvec); error = pci_enable_msix_exact(bfad->pcidev,
if (error) { msix_entries, bfad->nvec);
/* In CT1 & CT2, try to allocate just one vector */ /* In CT1 & CT2, try to allocate just one vector */
if (bfa_asic_id_ctc(pdev->device)) { if (error == -ENOSPC && bfa_asic_id_ctc(pdev->device)) {
printk(KERN_WARNING "bfa %s: trying one msix " printk(KERN_WARNING "bfa %s: trying one msix "
"vector failed to allocate %d[%d]\n", "vector failed to allocate %d[%d]\n",
bfad->pci_name, bfad->nvec, error); bfad->pci_name, bfad->nvec, error);
bfad->nvec = 1; bfad->nvec = 1;
error = pci_enable_msix(bfad->pcidev, error = pci_enable_msix_exact(bfad->pcidev,
msix_entries, bfad->nvec); msix_entries, 1);
} }
/* if (error) {
* Only error number of vector is available. printk(KERN_WARNING "bfad%d: "
* We don't have a mechanism to map multiple "pci_enable_msix_exact failed (%d), "
* interrupts into one vector, so even if we "use line based.\n",
* can try to request less vectors, we don't bfad->inst_no, error);
* know how to associate interrupt events to goto line_based;
* vectors. Linux doesn't duplicate vectors
* in the MSIX table for this case.
*/
if (error) {
printk(KERN_WARNING "bfad%d: "
"pci_enable_msix failed (%d), "
"use line based.\n",
bfad->inst_no, error);
goto line_based;
}
} }
/* Disable INTX in MSI-X mode */ /* Disable INTX in MSI-X mode */
...@@ -1281,20 +1271,18 @@ bfad_setup_intr(struct bfad_s *bfad) ...@@ -1281,20 +1271,18 @@ bfad_setup_intr(struct bfad_s *bfad)
bfad->bfad_flags |= BFAD_MSIX_ON; bfad->bfad_flags |= BFAD_MSIX_ON;
return error; return 0;
} }
line_based: line_based:
error = 0; error = request_irq(bfad->pcidev->irq, (irq_handler_t)bfad_intx,
if (request_irq BFAD_IRQ_FLAGS, BFAD_DRIVER_NAME, bfad);
(bfad->pcidev->irq, (irq_handler_t) bfad_intx, BFAD_IRQ_FLAGS, if (error)
BFAD_DRIVER_NAME, bfad) != 0) { return error;
/* Enable interrupt handler failed */
return 1;
}
bfad->bfad_flags |= BFAD_INTX_ON; bfad->bfad_flags |= BFAD_INTX_ON;
return error; return 0;
} }
void void
......
...@@ -257,8 +257,8 @@ int fnic_set_intr_mode(struct fnic *fnic) ...@@ -257,8 +257,8 @@ int fnic_set_intr_mode(struct fnic *fnic)
fnic->raw_wq_count >= m && fnic->raw_wq_count >= m &&
fnic->wq_copy_count >= o && fnic->wq_copy_count >= o &&
fnic->cq_count >= n + m + o) { fnic->cq_count >= n + m + o) {
if (!pci_enable_msix(fnic->pdev, fnic->msix_entry, if (!pci_enable_msix_exact(fnic->pdev, fnic->msix_entry,
n + m + o + 1)) { n + m + o + 1)) {
fnic->rq_count = n; fnic->rq_count = n;
fnic->raw_wq_count = m; fnic->raw_wq_count = m;
fnic->wq_copy_count = o; fnic->wq_copy_count = o;
......
...@@ -356,7 +356,7 @@ static int isci_setup_interrupts(struct pci_dev *pdev) ...@@ -356,7 +356,7 @@ static int isci_setup_interrupts(struct pci_dev *pdev)
for (i = 0; i < num_msix; i++) for (i = 0; i < num_msix; i++)
pci_info->msix_entries[i].entry = i; pci_info->msix_entries[i].entry = i;
err = pci_enable_msix(pdev, pci_info->msix_entries, num_msix); err = pci_enable_msix_exact(pdev, pci_info->msix_entries, num_msix);
if (err) if (err)
goto intx; goto intx;
......
...@@ -8242,7 +8242,7 @@ lpfc_sli_enable_msix(struct lpfc_hba *phba) ...@@ -8242,7 +8242,7 @@ lpfc_sli_enable_msix(struct lpfc_hba *phba)
if (rc) { if (rc) {
lpfc_printf_log(phba, KERN_INFO, LOG_INIT, lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"0420 PCI enable MSI-X failed (%d)\n", rc); "0420 PCI enable MSI-X failed (%d)\n", rc);
goto msi_fail_out; goto vec_fail_out;
} }
for (i = 0; i < LPFC_MSIX_VECTORS; i++) for (i = 0; i < LPFC_MSIX_VECTORS; i++)
lpfc_printf_log(phba, KERN_INFO, LOG_INIT, lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
...@@ -8320,6 +8320,8 @@ lpfc_sli_enable_msix(struct lpfc_hba *phba) ...@@ -8320,6 +8320,8 @@ lpfc_sli_enable_msix(struct lpfc_hba *phba)
msi_fail_out: msi_fail_out:
/* Unconfigure MSI-X capability structure */ /* Unconfigure MSI-X capability structure */
pci_disable_msix(phba->pcidev); pci_disable_msix(phba->pcidev);
vec_fail_out:
return rc; return rc;
} }
...@@ -8812,7 +8814,7 @@ lpfc_sli4_enable_msix(struct lpfc_hba *phba) ...@@ -8812,7 +8814,7 @@ lpfc_sli4_enable_msix(struct lpfc_hba *phba)
} else if (rc) { } else if (rc) {
lpfc_printf_log(phba, KERN_INFO, LOG_INIT, lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
"0484 PCI enable MSI-X failed (%d)\n", rc); "0484 PCI enable MSI-X failed (%d)\n", rc);
goto msi_fail_out; goto vec_fail_out;
} }
/* Log MSI-X vector assignment */ /* Log MSI-X vector assignment */
...@@ -8875,9 +8877,10 @@ lpfc_sli4_enable_msix(struct lpfc_hba *phba) ...@@ -8875,9 +8877,10 @@ lpfc_sli4_enable_msix(struct lpfc_hba *phba)
&phba->sli4_hba.fcp_eq_hdl[index]); &phba->sli4_hba.fcp_eq_hdl[index]);
} }
msi_fail_out:
/* Unconfigure MSI-X capability structure */ /* Unconfigure MSI-X capability structure */
pci_disable_msix(phba->pcidev); pci_disable_msix(phba->pcidev);
vec_fail_out:
return rc; return rc;
} }
......
...@@ -763,9 +763,10 @@ static u32 pm8001_setup_msix(struct pm8001_hba_info *pm8001_ha) ...@@ -763,9 +763,10 @@ static u32 pm8001_setup_msix(struct pm8001_hba_info *pm8001_ha)
pm8001_ha->irq_vector[i].irq_id = i; pm8001_ha->irq_vector[i].irq_id = i;
pm8001_ha->irq_vector[i].drv_inst = pm8001_ha; pm8001_ha->irq_vector[i].drv_inst = pm8001_ha;
if (request_irq(pm8001_ha->msix_entries[i].vector, rc = request_irq(pm8001_ha->msix_entries[i].vector,
pm8001_interrupt_handler_msix, flag, pm8001_interrupt_handler_msix, flag,
intr_drvname[i], &(pm8001_ha->irq_vector[i]))) { intr_drvname[i], &(pm8001_ha->irq_vector[i]));
if (rc) {
for (j = 0; j < i; j++) for (j = 0; j < i; j++)
free_irq( free_irq(
pm8001_ha->msix_entries[j].vector, pm8001_ha->msix_entries[j].vector,
......
...@@ -1194,7 +1194,7 @@ static int pvscsi_setup_msix(const struct pvscsi_adapter *adapter, ...@@ -1194,7 +1194,7 @@ static int pvscsi_setup_msix(const struct pvscsi_adapter *adapter,
struct msix_entry entry = { 0, PVSCSI_VECTOR_COMPLETION }; struct msix_entry entry = { 0, PVSCSI_VECTOR_COMPLETION };
int ret; int ret;
ret = pci_enable_msix(adapter->dev, &entry, 1); ret = pci_enable_msix_exact(adapter->dev, &entry, 1);
if (ret) if (ret)
return ret; return ret;
......
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