From: Greg Kroah-Hartman Date: Fri, 31 Jul 2015 00:02:55 +0000 (-0700) Subject: 3.10-stable patches X-Git-Tag: v4.1.4~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4732bb29fb8425a2b35d5c22a567b6bf918f3466;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: libata-add-ata_horkage_notrim.patch libata-force-disable-trim-for-supersspeed-s238.patch --- diff --git a/queue-3.10/libata-add-ata_horkage_notrim.patch b/queue-3.10/libata-add-ata_horkage_notrim.patch new file mode 100644 index 00000000000..31c433e2522 --- /dev/null +++ b/queue-3.10/libata-add-ata_horkage_notrim.patch @@ -0,0 +1,46 @@ +From 71d126fd28de2d4d9b7b2088dbccd7ca62fad6e0 Mon Sep 17 00:00:00 2001 +From: Arne Fitzenreiter +Date: Wed, 15 Jul 2015 13:54:36 +0200 +Subject: libata: add ATA_HORKAGE_NOTRIM + +From: Arne Fitzenreiter + +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 +Signed-off-by: Tejun Heo +Signed-off-by: Greg Kroah-Hartman + + +--- + drivers/ata/libata-scsi.c | 3 ++- + include/linux/libata.h | 1 + + 2 files changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/ata/libata-scsi.c ++++ b/drivers/ata/libata-scsi.c +@@ -2512,7 +2512,8 @@ static unsigned int ata_scsiop_read_cap( + 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)) +--- a/include/linux/libata.h ++++ b/include/linux/libata.h +@@ -409,6 +409,7 @@ enum { + ATA_HORKAGE_ATAPI_DMADIR = (1 << 18), /* device requires dmadir */ + 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 */ diff --git a/queue-3.10/libata-force-disable-trim-for-supersspeed-s238.patch b/queue-3.10/libata-force-disable-trim-for-supersspeed-s238.patch new file mode 100644 index 00000000000..8c18a520ddc --- /dev/null +++ b/queue-3.10/libata-force-disable-trim-for-supersspeed-s238.patch @@ -0,0 +1,33 @@ +From cda57b1b05cf7b8b99ab4b732bea0b05b6c015cc Mon Sep 17 00:00:00 2001 +From: Arne Fitzenreiter +Date: Wed, 15 Jul 2015 13:54:37 +0200 +Subject: libata: force disable trim for SuperSSpeed S238 + +From: Arne Fitzenreiter + +commit cda57b1b05cf7b8b99ab4b732bea0b05b6c015cc upstream. + +This device loses blocks, often the partition table area, on trim. +Disable TRIM. +http://pcengines.ch/msata16a.htm + +Signed-off-by: Arne Fitzenreiter +Signed-off-by: Tejun Heo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/ata/libata-core.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/ata/libata-core.c ++++ b/drivers/ata/libata-core.c +@@ -4201,6 +4201,9 @@ static const struct ata_blacklist_entry + { "PIONEER DVD-RW DVR-212D", NULL, ATA_HORKAGE_NOSETXFER }, + { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER }, + ++ /* devices that don't properly handle TRIM commands */ ++ { "SuperSSpeed S238*", NULL, ATA_HORKAGE_NOTRIM, }, ++ + /* + * Some WD SATA-I drives spin up and down erratically when the link + * is put into the slumber mode. We don't have full list of the diff --git a/queue-3.10/series b/queue-3.10/series index 232494c6629..ad65ecd4638 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -55,3 +55,5 @@ drm-radeon-don-t-flush-the-gart-tlb-if-rdev-gart.ptr-null.patch drm-add-a-check-for-x-y-in-drm_mode_setcrtc.patch xfs-fix-remote-symlinks-on-v5-crc-filesystems.patch vtpm-set-virtual-device-before-passing-to-ibmvtpm_reset_crq.patch +libata-add-ata_horkage_notrim.patch +libata-force-disable-trim-for-supersspeed-s238.patch