Commit f5b63206 authored by Kevin Barnett's avatar Kevin Barnett Committed by Martin K. Petersen

scsi: smartpqi: map more raid errors to SCSI errors

enhance mapping of RAID path errors to Linux SCSI host
error codes.
Reviewed-by: default avatarScott Benesh <scott.benesh@microsemi.com>
Signed-off-by: default avatarKevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: default avatarDon Brace <don.brace@microsemi.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 37b36847
...@@ -2441,13 +2441,43 @@ static void pqi_process_raid_io_error(struct pqi_io_request *io_request) ...@@ -2441,13 +2441,43 @@ static void pqi_process_raid_io_error(struct pqi_io_request *io_request)
scsi_status = error_info->status; scsi_status = error_info->status;
host_byte = DID_OK; host_byte = DID_OK;
if (error_info->data_out_result == PQI_DATA_IN_OUT_UNDERFLOW) { switch (error_info->data_out_result) {
case PQI_DATA_IN_OUT_GOOD:
break;
case PQI_DATA_IN_OUT_UNDERFLOW:
xfer_count = xfer_count =
get_unaligned_le32(&error_info->data_out_transferred); get_unaligned_le32(&error_info->data_out_transferred);
residual_count = scsi_bufflen(scmd) - xfer_count; residual_count = scsi_bufflen(scmd) - xfer_count;
scsi_set_resid(scmd, residual_count); scsi_set_resid(scmd, residual_count);
if (xfer_count < scmd->underflow) if (xfer_count < scmd->underflow)
host_byte = DID_SOFT_ERROR; host_byte = DID_SOFT_ERROR;
break;
case PQI_DATA_IN_OUT_UNSOLICITED_ABORT:
case PQI_DATA_IN_OUT_ABORTED:
host_byte = DID_ABORT;
break;
case PQI_DATA_IN_OUT_TIMEOUT:
host_byte = DID_TIME_OUT;
break;
case PQI_DATA_IN_OUT_BUFFER_OVERFLOW:
case PQI_DATA_IN_OUT_PROTOCOL_ERROR:
case PQI_DATA_IN_OUT_BUFFER_ERROR:
case PQI_DATA_IN_OUT_BUFFER_OVERFLOW_DESCRIPTOR_AREA:
case PQI_DATA_IN_OUT_BUFFER_OVERFLOW_BRIDGE:
case PQI_DATA_IN_OUT_ERROR:
case PQI_DATA_IN_OUT_HARDWARE_ERROR:
case PQI_DATA_IN_OUT_PCIE_FABRIC_ERROR:
case PQI_DATA_IN_OUT_PCIE_COMPLETION_TIMEOUT:
case PQI_DATA_IN_OUT_PCIE_COMPLETER_ABORT_RECEIVED:
case PQI_DATA_IN_OUT_PCIE_UNSUPPORTED_REQUEST_RECEIVED:
case PQI_DATA_IN_OUT_PCIE_ECRC_CHECK_FAILED:
case PQI_DATA_IN_OUT_PCIE_UNSUPPORTED_REQUEST:
case PQI_DATA_IN_OUT_PCIE_ACS_VIOLATION:
case PQI_DATA_IN_OUT_PCIE_TLP_PREFIX_BLOCKED:
case PQI_DATA_IN_OUT_PCIE_POISONED_MEMORY_READ:
default:
host_byte = DID_ERROR;
break;
} }
sense_data_length = get_unaligned_le16(&error_info->sense_data_length); sense_data_length = get_unaligned_le16(&error_info->sense_data_length);
......
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