aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2010-09-29 11:19:08 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-10-07 18:30:18 -0400
commiteee8877ee5e8a879f78034001b5e7c04db005ab2 (patch)
treec579b4079a590a950066f2405f22122a40fc6a99 /drivers/scsi/lpfc
parent515e0aa21ec399ddcf783140a596312e83d20a80 (diff)
[SCSI] lpfc 8.3.17: SCSI fixes
- Fail I/Os with incomplete data that complete with SCSI Check condition. - Complete aborted I/Os with host_scribble equal to NULL with success. - Initialize context1 field of iocbq in the new_scsi_buf routines. Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 6e331c73170e..3a658953486c 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -599,6 +599,7 @@ lpfc_new_scsi_buf_s3(struct lpfc_vport *vport, int num_to_alloc)
599 iocb->ulpClass = CLASS3; 599 iocb->ulpClass = CLASS3;
600 psb->status = IOSTAT_SUCCESS; 600 psb->status = IOSTAT_SUCCESS;
601 /* Put it back into the SCSI buffer list */ 601 /* Put it back into the SCSI buffer list */
602 psb->cur_iocbq.context1 = psb;
602 lpfc_release_scsi_buf_s3(phba, psb); 603 lpfc_release_scsi_buf_s3(phba, psb);
603 604
604 } 605 }
@@ -849,6 +850,7 @@ lpfc_new_scsi_buf_s4(struct lpfc_vport *vport, int num_to_alloc)
849 iocb->ulpBdeCount = 1; 850 iocb->ulpBdeCount = 1;
850 iocb->ulpLe = 1; 851 iocb->ulpLe = 1;
851 iocb->ulpClass = CLASS3; 852 iocb->ulpClass = CLASS3;
853 psb->cur_iocbq.context1 = psb;
852 if (phba->cfg_sg_dma_buf_size > SGL_PAGE_SIZE) 854 if (phba->cfg_sg_dma_buf_size > SGL_PAGE_SIZE)
853 pdma_phys_bpl1 = pdma_phys_bpl + SGL_PAGE_SIZE; 855 pdma_phys_bpl1 = pdma_phys_bpl + SGL_PAGE_SIZE;
854 else 856 else
@@ -2276,15 +2278,24 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
2276 * Check SLI validation that all the transfer was actually done 2278 * Check SLI validation that all the transfer was actually done
2277 * (fcpi_parm should be zero). Apply check only to reads. 2279 * (fcpi_parm should be zero). Apply check only to reads.
2278 */ 2280 */
2279 } else if ((scsi_status == SAM_STAT_GOOD) && fcpi_parm && 2281 } else if (fcpi_parm && (cmnd->sc_data_direction == DMA_FROM_DEVICE)) {
2280 (cmnd->sc_data_direction == DMA_FROM_DEVICE)) {
2281 lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP | LOG_FCP_ERROR, 2282 lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP | LOG_FCP_ERROR,
2282 "9029 FCP Read Check Error Data: " 2283 "9029 FCP Read Check Error Data: "
2283 "x%x x%x x%x x%x\n", 2284 "x%x x%x x%x x%x x%x\n",
2284 be32_to_cpu(fcpcmd->fcpDl), 2285 be32_to_cpu(fcpcmd->fcpDl),
2285 be32_to_cpu(fcprsp->rspResId), 2286 be32_to_cpu(fcprsp->rspResId),
2286 fcpi_parm, cmnd->cmnd[0]); 2287 fcpi_parm, cmnd->cmnd[0], scsi_status);
2287 host_status = DID_ERROR; 2288 switch (scsi_status) {
2289 case SAM_STAT_GOOD:
2290 case SAM_STAT_CHECK_CONDITION:
2291 /* Fabric dropped a data frame. Fail any successful
2292 * command in which we detected dropped frames.
2293 * A status of good or some check conditions could
2294 * be considered a successful command.
2295 */
2296 host_status = DID_ERROR;
2297 break;
2298 }
2288 scsi_set_resid(cmnd, scsi_bufflen(cmnd)); 2299 scsi_set_resid(cmnd, scsi_bufflen(cmnd));
2289 } 2300 }
2290 2301
@@ -3072,7 +3083,14 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd)
3072 if (ret) 3083 if (ret)
3073 return ret; 3084 return ret;
3074 lpfc_cmd = (struct lpfc_scsi_buf *)cmnd->host_scribble; 3085 lpfc_cmd = (struct lpfc_scsi_buf *)cmnd->host_scribble;
3075 BUG_ON(!lpfc_cmd); 3086 if (!lpfc_cmd) {
3087 lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
3088 "2873 SCSI Layer I/O Abort Request IO CMPL Status "
3089 "x%x ID %d "
3090 "LUN %d snum %#lx\n", ret, cmnd->device->id,
3091 cmnd->device->lun, cmnd->serial_number);
3092 return SUCCESS;
3093 }
3076 3094
3077 /* 3095 /*
3078 * If pCmd field of the corresponding lpfc_scsi_buf structure 3096 * If pCmd field of the corresponding lpfc_scsi_buf structure