aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2006-12-02 13:35:43 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-12-03 10:35:04 -0500
commitf56035110661417e15814fa08e1f4bf19cb26f93 (patch)
tree507622bf0e1d9b27823f21ba51ac654d3060e5c1 /drivers/scsi/lpfc
parenta12e07bc6297b6cb97889ca7dfbed6c39048b1c1 (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')
-rw-r--r--drivers/scsi/lpfc/lpfc_hw.h7
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c3
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c21
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c7
4 files changed, 35 insertions, 3 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h
index 3ba1ee4ace9a..f79cb6136906 100644
--- a/drivers/scsi/lpfc/lpfc_hw.h
+++ b/drivers/scsi/lpfc/lpfc_hw.h
@@ -1294,6 +1294,10 @@ typedef struct { /* FireFly BIU registers */
1294#define CMD_FCP_IREAD_CX 0x1B 1294#define CMD_FCP_IREAD_CX 0x1B
1295#define CMD_FCP_ICMND_CR 0x1C 1295#define CMD_FCP_ICMND_CR 0x1C
1296#define CMD_FCP_ICMND_CX 0x1D 1296#define CMD_FCP_ICMND_CX 0x1D
1297#define CMD_FCP_TSEND_CX 0x1F
1298#define CMD_FCP_TRECEIVE_CX 0x21
1299#define CMD_FCP_TRSP_CX 0x23
1300#define CMD_FCP_AUTO_TRSP_CX 0x29
1297 1301
1298#define CMD_ADAPTER_MSG 0x20 1302#define CMD_ADAPTER_MSG 0x20
1299#define CMD_ADAPTER_DUMP 0x22 1303#define CMD_ADAPTER_DUMP 0x22
@@ -1320,6 +1324,9 @@ typedef struct { /* FireFly BIU registers */
1320#define CMD_FCP_IREAD64_CX 0x9B 1324#define CMD_FCP_IREAD64_CX 0x9B
1321#define CMD_FCP_ICMND64_CR 0x9C 1325#define CMD_FCP_ICMND64_CR 0x9C
1322#define CMD_FCP_ICMND64_CX 0x9D 1326#define CMD_FCP_ICMND64_CX 0x9D
1327#define CMD_FCP_TSEND64_CX 0x9F
1328#define CMD_FCP_TRECEIVE64_CX 0xA1
1329#define CMD_FCP_TRSP64_CX 0xA3
1323 1330
1324#define CMD_GEN_REQUEST64_CR 0xC2 1331#define CMD_GEN_REQUEST64_CR 0xC2
1325#define CMD_GEN_REQUEST64_CX 0xC3 1332#define CMD_GEN_REQUEST64_CX 0xC3
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index cf9081c262d7..afca45cdbcef 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -519,7 +519,8 @@ lpfc_handle_eratt(struct lpfc_hba * phba)
519 struct lpfc_sli_ring *pring; 519 struct lpfc_sli_ring *pring;
520 uint32_t event_data; 520 uint32_t event_data;
521 521
522 if (phba->work_hs & HS_FFER6) { 522 if (phba->work_hs & HS_FFER6 ||
523 phba->work_hs & HS_FFER5) {
523 /* Re-establishing Link */ 524 /* Re-establishing Link */
524 lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT, 525 lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT,
525 "%d:1301 Re-establishing Link " 526 "%d:1301 Re-establishing Link "
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
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 120af3db635a..a4128e19338a 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -117,6 +117,10 @@ lpfc_sli_iocb_cmd_type(uint8_t iocb_cmnd)
117 case CMD_FCP_IREAD_CX: 117 case CMD_FCP_IREAD_CX:
118 case CMD_FCP_ICMND_CR: 118 case CMD_FCP_ICMND_CR:
119 case CMD_FCP_ICMND_CX: 119 case CMD_FCP_ICMND_CX:
120 case CMD_FCP_TSEND_CX:
121 case CMD_FCP_TRSP_CX:
122 case CMD_FCP_TRECEIVE_CX:
123 case CMD_FCP_AUTO_TRSP_CX:
120 case CMD_ADAPTER_MSG: 124 case CMD_ADAPTER_MSG:
121 case CMD_ADAPTER_DUMP: 125 case CMD_ADAPTER_DUMP:
122 case CMD_XMIT_SEQUENCE64_CR: 126 case CMD_XMIT_SEQUENCE64_CR:
@@ -131,6 +135,9 @@ lpfc_sli_iocb_cmd_type(uint8_t iocb_cmnd)
131 case CMD_FCP_IREAD64_CX: 135 case CMD_FCP_IREAD64_CX:
132 case CMD_FCP_ICMND64_CR: 136 case CMD_FCP_ICMND64_CR:
133 case CMD_FCP_ICMND64_CX: 137 case CMD_FCP_ICMND64_CX:
138 case CMD_FCP_TSEND64_CX:
139 case CMD_FCP_TRSP64_CX:
140 case CMD_FCP_TRECEIVE64_CX:
134 case CMD_GEN_REQUEST64_CR: 141 case CMD_GEN_REQUEST64_CR:
135 case CMD_GEN_REQUEST64_CX: 142 case CMD_GEN_REQUEST64_CX:
136 case CMD_XMIT_ELS_RSP64_CX: 143 case CMD_XMIT_ELS_RSP64_CX: