diff options
author | Arne Fitzenreiter <arne_f@ipfire.org> | 2015-07-15 13:54:36 +0200 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-08-04 14:29:36 -0400 |
commit | e7a84605061b205350654641d823e1ca9589ec24 (patch) | |
tree | c6aea731ed9d5173d8e38ad26cb312e9ad2abdfa /drivers/ata | |
parent | 7a889192e322242945874e52b25f88c8841c8f47 (diff) | |
download | linux-stable-e7a84605061b205350654641d823e1ca9589ec24.tar.gz linux-stable-e7a84605061b205350654641d823e1ca9589ec24.tar.bz2 linux-stable-e7a84605061b205350654641d823e1ca9589ec24.zip |
libata: add ATA_HORKAGE_NOTRIM
[ Upstream commit 71d126fd28de2d4d9b7b2088dbccd7ca62fad6e0 ]
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>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'drivers/ata')
-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 0586f66d70fa..d6ff64248c23 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)) |