Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

James Smart and committed by
James Bottomley
f5603511 a12e07bc

+35 -3
+7
drivers/scsi/lpfc/lpfc_hw.h
··· 1294 1294 #define CMD_FCP_IREAD_CX 0x1B 1295 1295 #define CMD_FCP_ICMND_CR 0x1C 1296 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 1302 #define CMD_ADAPTER_MSG 0x20 1299 1303 #define CMD_ADAPTER_DUMP 0x22 ··· 1324 1320 #define CMD_FCP_IREAD64_CX 0x9B 1325 1321 #define CMD_FCP_ICMND64_CR 0x9C 1326 1322 #define CMD_FCP_ICMND64_CX 0x9D 1323 + #define CMD_FCP_TSEND64_CX 0x9F 1324 + #define CMD_FCP_TRECEIVE64_CX 0xA1 1325 + #define CMD_FCP_TRSP64_CX 0xA3 1327 1326 1328 1327 #define CMD_GEN_REQUEST64_CR 0xC2 1329 1328 #define CMD_GEN_REQUEST64_CX 0xC3
+2 -1
drivers/scsi/lpfc/lpfc_init.c
··· 519 519 struct lpfc_sli_ring *pring; 520 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 524 /* Re-establishing Link */ 524 525 lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT, 525 526 "%d:1301 Re-establishing Link "
+19 -2
drivers/scsi/lpfc/lpfc_scsi.c
··· 679 679 struct lpfc_iocbq *iocbqrsp; 680 680 int ret; 681 681 682 + if (!rdata->pnode) 683 + return FAILED; 684 + 682 685 lpfc_cmd->rdata = rdata; 683 686 ret = lpfc_scsi_prep_task_mgmt_cmd(phba, lpfc_cmd, lun, 684 687 FCP_TARGET_RESET); ··· 988 985 989 986 lpfc_block_error_handler(cmnd); 990 987 spin_lock_irq(shost->host_lock); 988 + loopcnt = 0; 991 989 /* 992 990 * If target is not in a MAPPED state, delay the reset until 993 991 * target is rediscovered or devloss timeout expires. 994 992 */ 995 993 while ( 1 ) { 996 994 if (!pnode) 997 - break; 995 + return FAILED; 998 996 999 997 if (pnode->nlp_state != NLP_STE_MAPPED_NODE) { 1000 998 spin_unlock_irq(phba->host->host_lock); 1001 999 schedule_timeout_uninterruptible(msecs_to_jiffies(500)); 1002 1000 spin_lock_irq(phba->host->host_lock); 1001 + loopcnt++; 1002 + rdata = cmnd->device->hostdata; 1003 + if (!rdata || 1004 + (loopcnt > ((phba->cfg_devloss_tmo * 2) + 1))) { 1005 + lpfc_printf_log(phba, KERN_ERR, LOG_FCP, 1006 + "%d:0721 LUN Reset rport failure:" 1007 + " cnt x%x rdata x%p\n", 1008 + phba->brd_no, loopcnt, rdata); 1009 + goto out; 1010 + } 1011 + pnode = rdata->pnode; 1012 + if (!pnode) 1013 + return FAILED; 1003 1014 } 1004 - if ((pnode) && (pnode->nlp_state == NLP_STE_MAPPED_NODE)) 1015 + if (pnode->nlp_state == NLP_STE_MAPPED_NODE) 1005 1016 break; 1006 1017 } 1007 1018
+7
drivers/scsi/lpfc/lpfc_sli.c
··· 117 117 case CMD_FCP_IREAD_CX: 118 118 case CMD_FCP_ICMND_CR: 119 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 124 case CMD_ADAPTER_MSG: 121 125 case CMD_ADAPTER_DUMP: 122 126 case CMD_XMIT_SEQUENCE64_CR: ··· 135 131 case CMD_FCP_IREAD64_CX: 136 132 case CMD_FCP_ICMND64_CR: 137 133 case CMD_FCP_ICMND64_CX: 134 + case CMD_FCP_TSEND64_CX: 135 + case CMD_FCP_TRSP64_CX: 136 + case CMD_FCP_TRECEIVE64_CX: 138 137 case CMD_GEN_REQUEST64_CR: 139 138 case CMD_GEN_REQUEST64_CX: 140 139 case CMD_XMIT_ELS_RSP64_CX: