summaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2015-03-27 16:46:36 +0100
committerTejun Heo <tj@kernel.org>2015-03-27 11:59:22 -0400
commitfe7173c206de63fc28475ee6ae42ff95c05692de (patch)
treedb025adb8d7ee04592640035537add3f7c8dbe4d /drivers/ata/libata-core.c
parent42b966fbf35da9c87f08d98f9b8978edf9e717cf (diff)
downloadtalos-obmc-linux-fe7173c206de63fc28475ee6ae42ff95c05692de.tar.gz
talos-obmc-linux-fe7173c206de63fc28475ee6ae42ff95c05692de.zip
libata: Implement support for sense data reporting
ACS-4 defines a sense data reporting feature set. This patch implements support for it. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 4c35f0822d06..aebb7e305874 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2144,6 +2144,24 @@ static int ata_dev_config_ncq(struct ata_device *dev,
return 0;
}
+static void ata_dev_config_sense_reporting(struct ata_device *dev)
+{
+ unsigned int err_mask;
+
+ if (!ata_id_has_sense_reporting(dev->id))
+ return;
+
+ if (ata_id_sense_reporting_enabled(dev->id))
+ return;
+
+ err_mask = ata_dev_set_feature(dev, SETFEATURE_SENSE_DATA, 0x1);
+ if (err_mask) {
+ ata_dev_dbg(dev,
+ "failed to enable Sense Data Reporting, Emask 0x%x\n",
+ err_mask);
+ }
+}
+
/**
* ata_dev_configure - Configure the specified ATA/ATAPI device
* @dev: Target device to configure
@@ -2366,7 +2384,7 @@ int ata_dev_configure(struct ata_device *dev)
dev->devslp_timing[i] = sata_setting[j];
}
}
-
+ ata_dev_config_sense_reporting(dev);
dev->cdb_len = 16;
}
OpenPOWER on IntegriCloud