Skip to content

Commit 8ef860a

Browse files
ErwanAliasr1martinkpetersen
authored andcommitted
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: Erwan Velu <[email protected]> Acked-by: Don Brace <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 4155219 commit 8ef860a

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

drivers/scsi/smartpqi/smartpqi_init.c

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2755,16 +2755,25 @@ static void pqi_process_raid_io_error(struct pqi_io_request *io_request)
27552755
scsi_normalize_sense(error_info->data,
27562756
sense_data_length, &sshdr) &&
27572757
sshdr.sense_key == HARDWARE_ERROR &&
2758-
sshdr.asc == 0x3e &&
2759-
sshdr.ascq == 0x1) {
2758+
sshdr.asc == 0x3e) {
27602759
struct pqi_ctrl_info *ctrl_info = shost_to_hba(scmd->device->host);
27612760
struct pqi_scsi_dev *device = scmd->device->hostdata;
27622761

2763-
if (printk_ratelimit())
2764-
scmd_printk(KERN_ERR, scmd, "received 'logical unit failure' from controller for scsi %d:%d:%d:%d\n",
2765-
ctrl_info->scsi_host->host_no, device->bus, device->target, device->lun);
2766-
pqi_take_device_offline(scmd->device, "RAID");
2767-
host_byte = DID_NO_CONNECT;
2762+
switch (sshdr.ascq) {
2763+
case 0x1: /* LOGICAL UNIT FAILURE */
2764+
if (printk_ratelimit())
2765+
scmd_printk(KERN_ERR, scmd, "received 'logical unit failure' from controller for scsi %d:%d:%d:%d\n",
2766+
ctrl_info->scsi_host->host_no, device->bus, device->target, device->lun);
2767+
pqi_take_device_offline(scmd->device, "RAID");
2768+
host_byte = DID_NO_CONNECT;
2769+
break;
2770+
2771+
default: /* See http://www.t10.org/lists/asc-num.htm#ASC_3E */
2772+
if (printk_ratelimit())
2773+
scmd_printk(KERN_ERR, scmd, "received unhandled error %d from controller for scsi %d:%d:%d:%d\n",
2774+
sshdr.ascq, ctrl_info->scsi_host->host_no, device->bus, device->target, device->lun);
2775+
break;
2776+
}
27682777
}
27692778

27702779
if (sense_data_length > SCSI_SENSE_BUFFERSIZE)

0 commit comments

Comments
 (0)