aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2016-04-25 12:45:43 +0200
committerTejun Heo <tj@kernel.org>2016-05-09 12:36:44 -0400
commitd238ffd59d3c65c608f39a0ab2819b63c912f783 (patch)
tree274b8b6242f5abb60a2a9bd59e91cd9bdf1579fb /drivers/ata
parentMerge branch '4.7/scsi-queue' of git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi into for-4.7-zac (diff)
downloadlinux-dev-d238ffd59d3c65c608f39a0ab2819b63c912f783.tar.xz
linux-dev-d238ffd59d3c65c608f39a0ab2819b63c912f783.zip
libata: do not attempt to retrieve sense code twice
Do not call ata_request_sense() if the sense code is already present. Signed-off-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-eh.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 5b340ce4eeac..e81661981a09 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1660,7 +1660,7 @@ static void ata_eh_request_sense(struct ata_queued_cmd *qc,
return;
}
- if (!cmd)
+ if (!cmd || qc->flags & ATA_QCFLAG_SENSE_VALID)
return;
if (!ata_id_sense_reporting_enabled(dev->id)) {
@@ -1849,7 +1849,7 @@ void ata_eh_analyze_ncq_error(struct ata_link *link)
memcpy(&qc->result_tf, &tf, sizeof(tf));
qc->result_tf.flags = ATA_TFLAG_ISADDR | ATA_TFLAG_LBA | ATA_TFLAG_LBA48;
qc->err_mask |= AC_ERR_DEV | AC_ERR_NCQ;
- if (qc->result_tf.auxiliary) {
+ if ((qc->result_tf.command & ATA_SENSE) || qc->result_tf.auxiliary) {
char sense_key, asc, ascq;
sense_key = (qc->result_tf.auxiliary >> 16) & 0xff;