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

lpfc: Fix for lun discovery issue with saturn adapter.

FCP_CMD payload was not always properly initialized on SLI-3 devices.

Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>

authored by

James Smart and committed by
James Bottomley
4fbdf9cb ad490b6e

+20 -21
+20 -21
drivers/scsi/lpfc/lpfc_scsi.c
··· 1130 1130 } 1131 1131 1132 1132 /** 1133 + * lpfc_fcpcmd_to_iocb - copy the fcp_cmd data into the IOCB 1134 + * @data: A pointer to the immediate command data portion of the IOCB. 1135 + * @fcp_cmnd: The FCP Command that is provided by the SCSI layer. 1136 + * 1137 + * The routine copies the entire FCP command from @fcp_cmnd to @data while 1138 + * byte swapping the data to big endian format for transmission on the wire. 1139 + **/ 1140 + static void 1141 + lpfc_fcpcmd_to_iocb(uint8_t *data, struct fcp_cmnd *fcp_cmnd) 1142 + { 1143 + int i, j; 1144 + 1145 + for (i = 0, j = 0; i < sizeof(struct fcp_cmnd); 1146 + i += sizeof(uint32_t), j++) { 1147 + ((uint32_t *)data)[j] = cpu_to_be32(((uint32_t *)fcp_cmnd)[j]); 1148 + } 1149 + } 1150 + 1151 + /** 1133 1152 * lpfc_scsi_prep_dma_buf_s3 - DMA mapping for scsi buffer to SLI3 IF spec 1134 1153 * @phba: The Hba for which this call is being executed. 1135 1154 * @lpfc_cmd: The scsi buffer which is going to be mapped. ··· 1283 1264 * we need to set word 4 of IOCB here 1284 1265 */ 1285 1266 iocb_cmd->un.fcpi.fcpi_parm = scsi_bufflen(scsi_cmnd); 1267 + lpfc_fcpcmd_to_iocb(iocb_cmd->unsli3.fcp_ext.icd, fcp_cmnd); 1286 1268 return 0; 1287 1269 } 1288 1270 ··· 4147 4127 } 4148 4128 4149 4129 /** 4150 - * lpfc_fcpcmd_to_iocb - copy the fcp_cmd data into the IOCB 4151 - * @data: A pointer to the immediate command data portion of the IOCB. 4152 - * @fcp_cmnd: The FCP Command that is provided by the SCSI layer. 4153 - * 4154 - * The routine copies the entire FCP command from @fcp_cmnd to @data while 4155 - * byte swapping the data to big endian format for transmission on the wire. 4156 - **/ 4157 - static void 4158 - lpfc_fcpcmd_to_iocb(uint8_t *data, struct fcp_cmnd *fcp_cmnd) 4159 - { 4160 - int i, j; 4161 - for (i = 0, j = 0; i < sizeof(struct fcp_cmnd); 4162 - i += sizeof(uint32_t), j++) { 4163 - ((uint32_t *)data)[j] = cpu_to_be32(((uint32_t *)fcp_cmnd)[j]); 4164 - } 4165 - } 4166 - 4167 - /** 4168 4130 * lpfc_scsi_prep_cmnd - Wrapper func for convert scsi cmnd to FCP info unit 4169 4131 * @vport: The virtual port for which this call is being executed. 4170 4132 * @lpfc_cmd: The scsi command which needs to send. ··· 4225 4223 fcp_cmnd->fcpCntl3 = 0; 4226 4224 phba->fc4ControlRequests++; 4227 4225 } 4228 - if (phba->sli_rev == 3 && 4229 - !(phba->sli3_options & LPFC_SLI3_BG_ENABLED)) 4230 - lpfc_fcpcmd_to_iocb(iocb_cmd->unsli3.fcp_ext.icd, fcp_cmnd); 4231 4226 /* 4232 4227 * Finish initializing those IOCB fields that are independent 4233 4228 * of the scsi_cmnd request_buffer