diff options
author | Hannes Reinecke <hare@suse.de> | 2015-03-27 16:46:37 +0100 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2015-03-27 11:59:22 -0400 |
commit | a1524f226a02aa6edebd90ae0752e97cfd78b159 (patch) | |
tree | 3b694223de3a939c51271f779966f1a11c74c74b /drivers/ata/libata-scsi.c | |
parent | fe7173c206de63fc28475ee6ae42ff95c05692de (diff) | |
download | op-kernel-dev-a1524f226a02aa6edebd90ae0752e97cfd78b159.zip op-kernel-dev-a1524f226a02aa6edebd90ae0752e97cfd78b159.tar.gz |
libata-eh: Set 'information' field for autosense
If NCQ autosense or the sense data reporting feature is enabled
the LBA of the offending command should be stored in the sense
data 'information' field.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r-- | drivers/ata/libata-scsi.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 3ac5be3..3131adc 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -280,6 +280,18 @@ void ata_scsi_set_sense(struct scsi_cmnd *cmd, u8 sk, u8 asc, u8 ascq) scsi_build_sense_buffer(0, cmd->sense_buffer, sk, asc, ascq); } +void ata_scsi_set_sense_information(struct scsi_cmnd *cmd, + const struct ata_taskfile *tf) +{ + u64 information; + + if (!cmd) + return; + + information = ata_tf_read_block(tf, NULL); + scsi_set_sense_information(cmd->sense_buffer, information); +} + static ssize_t ata_scsi_em_message_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |