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