diff options
author | James Smart <James.Smart@Emulex.Com> | 2006-12-02 13:35:43 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-12-03 10:35:04 -0500 |
commit | f56035110661417e15814fa08e1f4bf19cb26f93 (patch) | |
tree | 507622bf0e1d9b27823f21ba51ac654d3060e5c1 /drivers/scsi/lpfc/lpfc_scsi.c | |
parent | a12e07bc6297b6cb97889ca7dfbed6c39048b1c1 (diff) |
[SCSI] lpfc 8.1.11 : Misc Fixes
Misc Fixes:
- Prevent references to NULL node list element in reset routines.
- Add missing IOCB types to switch tables
- Reset the card on Port Error 5
- Fix infinite loop in LUN reset
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_scsi.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_scsi.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index 125179af470c..c3e68e0d8f74 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c | |||
@@ -679,6 +679,9 @@ lpfc_scsi_tgt_reset(struct lpfc_scsi_buf * lpfc_cmd, struct lpfc_hba * phba, | |||
679 | struct lpfc_iocbq *iocbqrsp; | 679 | struct lpfc_iocbq *iocbqrsp; |
680 | int ret; | 680 | int ret; |
681 | 681 | ||
682 | if (!rdata->pnode) | ||
683 | return FAILED; | ||
684 | |||
682 | lpfc_cmd->rdata = rdata; | 685 | lpfc_cmd->rdata = rdata; |
683 | ret = lpfc_scsi_prep_task_mgmt_cmd(phba, lpfc_cmd, lun, | 686 | ret = lpfc_scsi_prep_task_mgmt_cmd(phba, lpfc_cmd, lun, |
684 | FCP_TARGET_RESET); | 687 | FCP_TARGET_RESET); |
@@ -985,20 +988,34 @@ lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) | |||
985 | 988 | ||
986 | lpfc_block_error_handler(cmnd); | 989 | lpfc_block_error_handler(cmnd); |
987 | spin_lock_irq(shost->host_lock); | 990 | spin_lock_irq(shost->host_lock); |
991 | loopcnt = 0; | ||
988 | /* | 992 | /* |
989 | * If target is not in a MAPPED state, delay the reset until | 993 | * If target is not in a MAPPED state, delay the reset until |
990 | * target is rediscovered or devloss timeout expires. | 994 | * target is rediscovered or devloss timeout expires. |
991 | */ | 995 | */ |
992 | while ( 1 ) { | 996 | while ( 1 ) { |
993 | if (!pnode) | 997 | if (!pnode) |
994 | break; | 998 | return FAILED; |
995 | 999 | ||
996 | if (pnode->nlp_state != NLP_STE_MAPPED_NODE) { | 1000 | if (pnode->nlp_state != NLP_STE_MAPPED_NODE) { |
997 | spin_unlock_irq(phba->host->host_lock); | 1001 | spin_unlock_irq(phba->host->host_lock); |
998 | schedule_timeout_uninterruptible(msecs_to_jiffies(500)); | 1002 | schedule_timeout_uninterruptible(msecs_to_jiffies(500)); |
999 | spin_lock_irq(phba->host->host_lock); | 1003 | spin_lock_irq(phba->host->host_lock); |
1004 | loopcnt++; | ||
1005 | rdata = cmnd->device->hostdata; | ||
1006 | if (!rdata || | ||
1007 | (loopcnt > ((phba->cfg_devloss_tmo * 2) + 1))) { | ||
1008 | lpfc_printf_log(phba, KERN_ERR, LOG_FCP, | ||
1009 | "%d:0721 LUN Reset rport failure:" | ||
1010 | " cnt x%x rdata x%p\n", | ||
1011 | phba->brd_no, loopcnt, rdata); | ||
1012 | goto out; | ||
1013 | } | ||
1014 | pnode = rdata->pnode; | ||
1015 | if (!pnode) | ||
1016 | return FAILED; | ||
1000 | } | 1017 | } |
1001 | if ((pnode) && (pnode->nlp_state == NLP_STE_MAPPED_NODE)) | 1018 | if (pnode->nlp_state == NLP_STE_MAPPED_NODE) |
1002 | break; | 1019 | break; |
1003 | } | 1020 | } |
1004 | 1021 | ||