Commit 8ef860ae authored by Erwan Velu's avatar Erwan Velu Committed by Martin K. Petersen

scsi: smartpqi: Reporting unhandled SCSI errors

When a HARDWARE_ERROR is triggered for ASC=0x3e, the existing code is only
considering the case where ASCQ=0x1.

According to the http://www.t10.org/lists/asc-num.htm#ASC_3E specification,
other values may occur like a timeout (ASCQ=0x2).

This patch prints an error message when a non-handled message is received.
This can help diagnose a possible misbehavior of the controller or a
missing implementation in the Linux kernel.

This patch keeps the exact same error handling but prints a message if an
ASCQ != 1 is reported.

[mkp: clarified commit message]
Signed-off-by: default avatarErwan Velu <e.velu@criteo.com>
Acked-by: default avatarDon Brace <don.brace@microsemi.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 41552199
...@@ -2755,16 +2755,25 @@ static void pqi_process_raid_io_error(struct pqi_io_request *io_request) ...@@ -2755,16 +2755,25 @@ static void pqi_process_raid_io_error(struct pqi_io_request *io_request)
scsi_normalize_sense(error_info->data, scsi_normalize_sense(error_info->data,
sense_data_length, &sshdr) && sense_data_length, &sshdr) &&
sshdr.sense_key == HARDWARE_ERROR && sshdr.sense_key == HARDWARE_ERROR &&
sshdr.asc == 0x3e && sshdr.asc == 0x3e) {
sshdr.ascq == 0x1) {
struct pqi_ctrl_info *ctrl_info = shost_to_hba(scmd->device->host); struct pqi_ctrl_info *ctrl_info = shost_to_hba(scmd->device->host);
struct pqi_scsi_dev *device = scmd->device->hostdata; struct pqi_scsi_dev *device = scmd->device->hostdata;
if (printk_ratelimit()) switch (sshdr.ascq) {
scmd_printk(KERN_ERR, scmd, "received 'logical unit failure' from controller for scsi %d:%d:%d:%d\n", case 0x1: /* LOGICAL UNIT FAILURE */
ctrl_info->scsi_host->host_no, device->bus, device->target, device->lun); if (printk_ratelimit())
pqi_take_device_offline(scmd->device, "RAID"); scmd_printk(KERN_ERR, scmd, "received 'logical unit failure' from controller for scsi %d:%d:%d:%d\n",
host_byte = DID_NO_CONNECT; ctrl_info->scsi_host->host_no, device->bus, device->target, device->lun);
pqi_take_device_offline(scmd->device, "RAID");
host_byte = DID_NO_CONNECT;
break;
default: /* See http://www.t10.org/lists/asc-num.htm#ASC_3E */
if (printk_ratelimit())
scmd_printk(KERN_ERR, scmd, "received unhandled error %d from controller for scsi %d:%d:%d:%d\n",
sshdr.ascq, ctrl_info->scsi_host->host_no, device->bus, device->target, device->lun);
break;
}
} }
if (sense_data_length > SCSI_SENSE_BUFFERSIZE) if (sense_data_length > SCSI_SENSE_BUFFERSIZE)
......
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