summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_init.c
diff options
context:
space:
mode:
authorJames Smart2006-07-06 21:49:56 +0200
committerJames Bottomley2006-07-09 17:21:28 +0200
commit688a88635f9d0d9251d35198e931eaac8816abef (patch)
treea7a78fee8bfb6bf1552484235be17ce406d76b70 /drivers/scsi/lpfc/lpfc_init.c
parent[SCSI] lpfc 8.1.7: Issue DOWN_LINK prior to INIT_LINK to work around link fai... (diff)
downloadkernel-qcow2-linux-688a88635f9d0d9251d35198e931eaac8816abef.tar.gz
kernel-qcow2-linux-688a88635f9d0d9251d35198e931eaac8816abef.tar.xz
kernel-qcow2-linux-688a88635f9d0d9251d35198e931eaac8816abef.zip
[SCSI] lpfc 8.1.7: Fix txcmplq related panics on heavy IO while downloading firmware
Fix txcmplq related panics on heavy IO while downloading firmware Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-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)
struct lpfc_sli_ring *pring;
struct lpfc_sli *psli;
unsigned long iflag;
- int i = 0;
+ int i;
+ int cnt = 0;
if (!phba)
return 0;
@@ -1348,17 +1349,26 @@ lpfc_offline(struct lpfc_hba * phba)
return 0;
psli = &phba->sli;
- pring = &psli->ring[psli->fcp_ring];
lpfc_linkdown(phba);
- /* The linkdown event takes 30 seconds to timeout. */
- while (pring->txcmplq_cnt) {
- mdelay(10);
- if (i++ > 3000)
- break;
+ for (i = 0; i < psli->num_rings; i++) {
+ pring = &psli->ring[i];
+ /* The linkdown event takes 30 seconds to timeout. */
+ while (pring->txcmplq_cnt) {
+ mdelay(10);
+ if (cnt++ > 3000) {
+ lpfc_printf_log(phba,
+ KERN_WARNING, LOG_INIT,
+ "%d:0466 Outstanding IO when "
+ "bringing Adapter offline\n",
+ phba->brd_no);
+ break;
+ }
+ }
}
+
/* stop all timers associated with this hba */
lpfc_stop_timer(phba);
phba->work_hba_events = 0;