aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_isr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_isr.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 2003dbb70579..40325ec70056 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -805,7 +805,7 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt)
805 uint16_t scsi_status; 805 uint16_t scsi_status;
806 uint8_t lscsi_status; 806 uint8_t lscsi_status;
807 int32_t resid; 807 int32_t resid;
808 uint32_t sense_len, rsp_info_len, resid_len; 808 uint32_t sense_len, rsp_info_len, resid_len, fw_resid_len;
809 uint8_t *rsp_info, *sense_data; 809 uint8_t *rsp_info, *sense_data;
810 810
811 sts = (sts_entry_t *) pkt; 811 sts = (sts_entry_t *) pkt;
@@ -859,11 +859,12 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt)
859 859
860 fcport = sp->fcport; 860 fcport = sp->fcport;
861 861
862 sense_len = rsp_info_len = resid_len = 0; 862 sense_len = rsp_info_len = resid_len = fw_resid_len = 0;
863 if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { 863 if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
864 sense_len = le32_to_cpu(sts24->sense_len); 864 sense_len = le32_to_cpu(sts24->sense_len);
865 rsp_info_len = le32_to_cpu(sts24->rsp_data_len); 865 rsp_info_len = le32_to_cpu(sts24->rsp_data_len);
866 resid_len = le32_to_cpu(sts24->rsp_residual_count); 866 resid_len = le32_to_cpu(sts24->rsp_residual_count);
867 fw_resid_len = le32_to_cpu(sts24->residual_len);
867 rsp_info = sts24->data; 868 rsp_info = sts24->data;
868 sense_data = sts24->data; 869 sense_data = sts24->data;
869 host_to_fcp_swap(sts24->data, sizeof(sts24->data)); 870 host_to_fcp_swap(sts24->data, sizeof(sts24->data));
@@ -963,14 +964,21 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt)
963 964
964 case CS_DATA_UNDERRUN: 965 case CS_DATA_UNDERRUN:
965 resid = resid_len; 966 resid = resid_len;
967 /* Use F/W calculated residual length. */
968 if (IS_QLA24XX(ha) || IS_QLA54XX(ha))
969 resid = fw_resid_len;
970
966 if (scsi_status & SS_RESIDUAL_UNDER) { 971 if (scsi_status & SS_RESIDUAL_UNDER) {
967 cp->resid = resid; 972 cp->resid = resid;
968 CMD_RESID_LEN(cp) = resid; 973 CMD_RESID_LEN(cp) = resid;
969 } else { 974 } else {
970 DEBUG2(printk(KERN_INFO 975 DEBUG2(printk(KERN_INFO
971 "scsi(%ld:%d:%d) UNDERRUN status detected " 976 "scsi(%ld:%d:%d) UNDERRUN status detected "
972 "0x%x-0x%x.\n", ha->host_no, cp->device->id, 977 "0x%x-0x%x. resid=0x%x fw_resid=0x%x cdb=0x%x "
973 cp->device->lun, comp_status, scsi_status)); 978 "os_underflow=0x%x\n", ha->host_no,
979 cp->device->id, cp->device->lun, comp_status,
980 scsi_status, resid_len, resid, cp->cmnd[0],
981 cp->underflow));
974 982
975 } 983 }
976 984