diff options
author | Ravi Anand <ravi.anand@qlogic.com> | 2006-05-17 18:08:55 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-05-20 10:41:02 -0400 |
commit | ed17c71b5d11327efd40666fd621486f964fae4f (patch) | |
tree | 63fa5ae594acb8a66361ead95f43001fd0630945 /drivers/scsi/qla2xxx | |
parent | 45aeaf1e8e4552ef82d3ff7a06e526e6d635f767 (diff) |
[SCSI] qla2xxx: Use FW calculated residual count for underrun handling.
With ISP24XX and ISP54XX parts.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_fw.h | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_isr.c | 16 |
2 files changed, 13 insertions, 5 deletions
diff --git a/drivers/scsi/qla2xxx/qla_fw.h b/drivers/scsi/qla2xxx/qla_fw.h index 1ee58ad2f4dd..d2f5870628da 100644 --- a/drivers/scsi/qla2xxx/qla_fw.h +++ b/drivers/scsi/qla2xxx/qla_fw.h | |||
@@ -463,7 +463,7 @@ struct sts_entry_24xx { | |||
463 | uint16_t comp_status; /* Completion status. */ | 463 | uint16_t comp_status; /* Completion status. */ |
464 | uint16_t ox_id; /* OX_ID used by the firmware. */ | 464 | uint16_t ox_id; /* OX_ID used by the firmware. */ |
465 | 465 | ||
466 | uint32_t residual_len; /* Residual transfer length. */ | 466 | uint32_t residual_len; /* FW calc residual transfer length. */ |
467 | 467 | ||
468 | uint16_t reserved_1; | 468 | uint16_t reserved_1; |
469 | uint16_t state_flags; /* State flags. */ | 469 | uint16_t state_flags; /* State flags. */ |
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 | ||