summaryrefslogtreecommitdiff
path: root/drivers/ata
diff options
context:
space:
mode:
authorArne Fitzenreiter <arne_f@ipfire.org>2015-07-15 14:54:36 +0300
committerLuis Henriques <luis.henriques@canonical.com>2015-08-11 11:57:31 +0300
commit17702a9ba8c13611c6c94d23401183cbcfd06b26 (patch)
treef3112c15eeaa7c2e8f10ef7ab7f36bcc105493ba /drivers/ata
parente61ee9bb4e456e8e4b7e66e6f0b796e2d09e942b (diff)
downloadlinux-17702a9ba8c13611c6c94d23401183cbcfd06b26.tar.xz
libata: add ATA_HORKAGE_NOTRIM
commit 71d126fd28de2d4d9b7b2088dbccd7ca62fad6e0 upstream. Some devices lose data on TRIM whether queued or not. This patch adds a horkage to disable TRIM. tj: Collapsed unnecessary if() nesting. Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org> Signed-off-by: Tejun Heo <tj@kernel.org> [ luis: backported to 3.16: - dropped changes to show_ata_dev_trim - adjusted context ] Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-scsi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 72691fd93948..30af1877fcea 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -2514,7 +2514,8 @@ static unsigned int ata_scsiop_read_cap(struct ata_scsi_args *args, u8 *rbuf)
rbuf[14] = (lowest_aligned >> 8) & 0x3f;
rbuf[15] = lowest_aligned;
- if (ata_id_has_trim(args->id)) {
+ if (ata_id_has_trim(args->id) &&
+ !(dev->horkage & ATA_HORKAGE_NOTRIM)) {
rbuf[14] |= 0x80; /* TPE */
if (ata_id_has_zero_after_trim(args->id))