diff options
author | Arne Fitzenreiter <arne_f@ipfire.org> | 2015-07-15 13:54:36 +0200 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2015-08-04 16:52:21 +0200 |
commit | 52335e40ca525484a6995d7b0c1260faa0de1edd (patch) | |
tree | eea3acabc22278b08969faac434e7dc223cd1798 /drivers | |
parent | 7306b7b3de26a0773270799e257d78fde6bce68e (diff) |
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>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/libata-scsi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index ef8567de6a75..6fecf0bde105 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -2510,7 +2510,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)) |