Commit 45634a86 authored by James Smart's avatar James Smart Committed by Martin K. Petersen

scsi: lpfc: Treat SCSI Write operation Underruns as an error

Currently, write underruns (mismatch of amount transferred vs scsi
status and its residual) detected by the adapter are not being flagged
as an error. Its expected the target controls the data transfer and
would appropriately set the RSP values.  Only read underruns are treated
as errors.

Revise the SCSI error handling to treat write underruns as an error as
well.
Signed-off-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: default avatarJames Smart <james.smart@broadcom.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 8d731d1a
...@@ -3772,20 +3772,18 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd, ...@@ -3772,20 +3772,18 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
scsi_set_resid(cmnd, be32_to_cpu(fcprsp->rspResId)); scsi_set_resid(cmnd, be32_to_cpu(fcprsp->rspResId));
lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP_UNDER, lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP_UNDER,
"9025 FCP Read Underrun, expected %d, " "9025 FCP Underrun, expected %d, "
"residual %d Data: x%x x%x x%x\n", "residual %d Data: x%x x%x x%x\n",
fcpDl, fcpDl,
scsi_get_resid(cmnd), fcpi_parm, cmnd->cmnd[0], scsi_get_resid(cmnd), fcpi_parm, cmnd->cmnd[0],
cmnd->underflow); cmnd->underflow);
/* /*
* If there is an under run check if under run reported by * If there is an under run, check if under run reported by
* storage array is same as the under run reported by HBA. * storage array is same as the under run reported by HBA.
* If this is not same, there is a dropped frame. * If this is not same, there is a dropped frame.
*/ */
if ((cmnd->sc_data_direction == DMA_FROM_DEVICE) && if (fcpi_parm && (scsi_get_resid(cmnd) != fcpi_parm)) {
fcpi_parm &&
(scsi_get_resid(cmnd) != fcpi_parm)) {
lpfc_printf_vlog(vport, KERN_WARNING, lpfc_printf_vlog(vport, KERN_WARNING,
LOG_FCP | LOG_FCP_ERROR, LOG_FCP | LOG_FCP_ERROR,
"9026 FCP Read Check Error " "9026 FCP Read Check Error "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment