diff options
author | Alexander Gordeev <agordeev@redhat.com> | 2014-07-16 14:05:06 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-07-29 08:38:52 -0400 |
commit | cd69a09eb2851b3320a8526781916f5a2a1660a2 (patch) | |
tree | 03e734db3f02b17d242903230e5c490d886e1ca0 /drivers/scsi/bfa/bfad.c | |
parent | 1e5df2a5332a865fc8a724b5455e29028852a905 (diff) |
bfa: Do not call pci_enable_msix() after it failed once
Function pci_enable_msix() should not be called in case
it threw a negative errno from a previous call.
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Acked-by: Anil Gurumurthy <anil.gurumurthy@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/bfa/bfad.c')
-rw-r--r-- | drivers/scsi/bfa/bfad.c | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index 7593b7c1d336..bb931808328f 100644 --- a/drivers/scsi/bfa/bfad.c +++ b/drivers/scsi/bfa/bfad.c | |||
@@ -1235,33 +1235,31 @@ bfad_setup_intr(struct bfad_s *bfad) | |||
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(bfad->pcidev, msix_entries, bfad->nvec); |
1238 | if (error) { | 1238 | /* In CT1 & CT2, try to allocate just one vector */ |
1239 | /* In CT1 & CT2, try to allocate just one vector */ | 1239 | if (error > 0 && bfa_asic_id_ctc(pdev->device)) { |
1240 | if (bfa_asic_id_ctc(pdev->device)) { | 1240 | printk(KERN_WARNING "bfa %s: trying one msix " |
1241 | printk(KERN_WARNING "bfa %s: trying one msix " | 1241 | "vector failed to allocate %d[%d]\n", |
1242 | "vector failed to allocate %d[%d]\n", | 1242 | bfad->pci_name, bfad->nvec, error); |
1243 | bfad->pci_name, bfad->nvec, error); | 1243 | bfad->nvec = 1; |
1244 | bfad->nvec = 1; | 1244 | error = pci_enable_msix(bfad->pcidev, |
1245 | error = pci_enable_msix(bfad->pcidev, | ||
1246 | msix_entries, bfad->nvec); | 1245 | msix_entries, bfad->nvec); |
1247 | } | 1246 | } |
1248 | 1247 | ||
1249 | /* | 1248 | /* |
1250 | * Only error number of vector is available. | 1249 | * Only error number of vector is available. |
1251 | * We don't have a mechanism to map multiple | 1250 | * We don't have a mechanism to map multiple |
1252 | * interrupts into one vector, so even if we | 1251 | * interrupts into one vector, so even if we |
1253 | * can try to request less vectors, we don't | 1252 | * can try to request less vectors, we don't |
1254 | * know how to associate interrupt events to | 1253 | * know how to associate interrupt events to |
1255 | * vectors. Linux doesn't duplicate vectors | 1254 | * vectors. Linux doesn't duplicate vectors |
1256 | * in the MSIX table for this case. | 1255 | * in the MSIX table for this case. |
1257 | */ | 1256 | */ |
1258 | if (error) { | 1257 | if (error) { |
1259 | printk(KERN_WARNING "bfad%d: " | 1258 | printk(KERN_WARNING "bfad%d: " |
1260 | "pci_enable_msix failed (%d), " | 1259 | "pci_enable_msix failed (%d), " |
1261 | "use line based.\n", | 1260 | "use line based.\n", |
1262 | bfad->inst_no, error); | 1261 | bfad->inst_no, error); |
1263 | goto line_based; | 1262 | goto line_based; |
1264 | } | ||
1265 | } | 1263 | } |
1266 | 1264 | ||
1267 | /* Disable INTX in MSI-X mode */ | 1265 | /* Disable INTX in MSI-X mode */ |