diff options
author | Hannes Reinecke <hare@suse.de> | 2016-04-04 11:43:55 +0200 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2016-04-04 12:07:40 -0400 |
commit | e87fd28cf9a2d9018ac4b6dd92f0b417714bc18d (patch) | |
tree | 768ef4257ff8ae50cdb54e63a05919c14bf29e1c /drivers/ata/libata-core.c | |
parent | 5b01e4b9efa0b78672cbbea830c9fbcc7f239e29 (diff) | |
download | lwn-e87fd28cf9a2d9018ac4b6dd92f0b417714bc18d.tar.gz lwn-e87fd28cf9a2d9018ac4b6dd92f0b417714bc18d.zip |
libata: Implement support for sense data reporting
ACS-4 defines a sense data reporting feature set.
This patch implements support for it.
tj: Cosmetic formatting updates.
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.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 55e257c268dd..f991f786227e 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -2148,6 +2148,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 @@ -2370,7 +2388,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; } |