summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6435118)
raw | patch | inline | side by side (parent: 6435118)
author | Arne Fitzenreiter <arne_f@ipfire.org> | |
Wed, 15 Jul 2015 11:54:36 +0000 (13:54 +0200) | ||
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
Mon, 3 Aug 2015 16:29:56 +0000 (09:29 -0700) |
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/ata/libata-scsi.c | patch | blob | history | |
include/linux/libata.h | patch | blob | history |
index ef8567de6a7515b45631f4a06f3447fe0604f0b3..6fecf0bde105d7d61029fd5def633b03caaa6190 100644 (file)
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))
diff --git a/include/linux/libata.h b/include/linux/libata.h
index b84e786ff990c7077e86477b220a82edeaf3eb5a..189c9ff97b29d157c5189c9d26e8978d09bf5413 100644 (file)
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
ATA_HORKAGE_NO_NCQ_TRIM = (1 << 19), /* don't use queued TRIM */
ATA_HORKAGE_NOLPM = (1 << 20), /* don't use LPM */
ATA_HORKAGE_WD_BROKEN_LPM = (1 << 21), /* some WDs have broken LPM */
+ ATA_HORKAGE_NOTRIM = (1 << 24), /* don't use TRIM */
/* DMA mask for user DMA control: User visible values; DO NOT
renumber */