summaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_error.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2017-10-17 10:11:24 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2017-10-19 03:55:40 +0300
commitcf3431bba1df3b4f25b04900cb804d7e6e5eb6a9 (patch)
treeba9389d8a63f3aa496825e1c0c0dd56aa5f0b9fe /drivers/scsi/scsi_error.c
parenta8bbb2ab4e4fac8ebd2a402d5d81500cbeaaebaf (diff)
downloadlinux-cf3431bba1df3b4f25b04900cb804d7e6e5eb6a9.tar.xz
scsi: scsi_error: Handle power-on reset unit attention
As per SAM there is a status precedence, with any sense code 29/XX taking second place just after an ACA ACTIVE status. Additionally, each target might prefer to not queue any unit attention conditions, but just report one. Due to the above, this will be that one with the highest precedence. This results in the sense code 29/XX effectively overwriting any other unit attention. Hence we should report the power-on reset to userland so that it can take appropriate action. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r--drivers/scsi/scsi_error.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 5086489dac97..d670027f598f 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -403,6 +403,12 @@ static void scsi_report_sense(struct scsi_device *sdev,
"threshold.\n");
}
+ if (sshdr->asc == 0x29) {
+ evt_type = SDEV_EVT_POWER_ON_RESET_OCCURRED;
+ sdev_printk(KERN_WARNING, sdev,
+ "Power-on or device reset occurred\n");
+ }
+
if (sshdr->asc == 0x2a && sshdr->ascq == 0x01) {
evt_type = SDEV_EVT_MODE_PARAMETER_CHANGE_REPORTED;
sdev_printk(KERN_WARNING, sdev,