aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 81755a3f7c68..2944eda1e907 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -1339,7 +1339,8 @@ lpfc_offline(struct lpfc_hba * phba)
1339 struct lpfc_sli_ring *pring; 1339 struct lpfc_sli_ring *pring;
1340 struct lpfc_sli *psli; 1340 struct lpfc_sli *psli;
1341 unsigned long iflag; 1341 unsigned long iflag;
1342 int i = 0; 1342 int i;
1343 int cnt = 0;
1343 1344
1344 if (!phba) 1345 if (!phba)
1345 return 0; 1346 return 0;
@@ -1348,17 +1349,26 @@ lpfc_offline(struct lpfc_hba * phba)
1348 return 0; 1349 return 0;
1349 1350
1350 psli = &phba->sli; 1351 psli = &phba->sli;
1351 pring = &psli->ring[psli->fcp_ring];
1352 1352
1353 lpfc_linkdown(phba); 1353 lpfc_linkdown(phba);
1354 1354
1355 /* The linkdown event takes 30 seconds to timeout. */ 1355 for (i = 0; i < psli->num_rings; i++) {
1356 while (pring->txcmplq_cnt) { 1356 pring = &psli->ring[i];
1357 mdelay(10); 1357 /* The linkdown event takes 30 seconds to timeout. */
1358 if (i++ > 3000) 1358 while (pring->txcmplq_cnt) {
1359 break; 1359 mdelay(10);
1360 if (cnt++ > 3000) {
1361 lpfc_printf_log(phba,
1362 KERN_WARNING, LOG_INIT,
1363 "%d:0466 Outstanding IO when "
1364 "bringing Adapter offline\n",
1365 phba->brd_no);
1366 break;
1367 }
1368 }
1360 } 1369 }
1361 1370
1371
1362 /* stop all timers associated with this hba */ 1372 /* stop all timers associated with this hba */
1363 lpfc_stop_timer(phba); 1373 lpfc_stop_timer(phba);
1364 phba->work_hba_events = 0; 1374 phba->work_hba_events = 0;