Files
bpfire/src/patches/linux-3.14.43_SuperSSpeed_NOTRIM.patch
Arne Fitzenreiter c9ab30c5d3 kernel: fix trim dataloss on some solid state discs
disable trim on SuperSSpeed S238
update queued trim blacklist from kernel 4.2rc1
(add Samsung SSD 8xx and some Crucial and Micron SSD)
2015-07-13 22:00:57 +02:00

48 lines
1.9 KiB
Diff

diff -Naur linux-3.14.43.org/drivers/ata/libata-core.c linux-3.14.43/drivers/ata/libata-core.c
--- linux-3.14.43.org/drivers/ata/libata-core.c 2015-05-17 18:54:01.000000000 +0200
+++ linux-3.14.43/drivers/ata/libata-core.c 2015-07-11 19:15:01.450041507 +0200
@@ -4229,6 +4229,9 @@
{ "Micron_M550*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, },
{ "Crucial_CT*M550SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, },
+ /* 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 -Naur linux-3.14.43.org/drivers/ata/libata-scsi.c linux-3.14.43/drivers/ata/libata-scsi.c
--- linux-3.14.43.org/drivers/ata/libata-scsi.c 2015-05-17 18:54:01.000000000 +0200
+++ linux-3.14.43/drivers/ata/libata-scsi.c 2015-07-11 20:47:22.570021716 +0200
@@ -2510,11 +2513,15 @@
rbuf[14] = (lowest_aligned >> 8) & 0x3f;
rbuf[15] = lowest_aligned;
- if (ata_id_has_trim(args->id)) {
- rbuf[14] |= 0x80; /* TPE */
- if (ata_id_has_zero_after_trim(args->id))
- rbuf[14] |= 0x40; /* TPRZ */
+
+ if (!(dev->horkage & ATA_HORKAGE_NOTRIM)) {
+ if (ata_id_has_trim(args->id)) {
+ rbuf[14] |= 0x80; /* TPE */
+
+ if (ata_id_has_zero_after_trim(args->id))
+ rbuf[14] |= 0x40; /* TPRZ */
+ }
}
}
diff -Naur linux-3.14.43.org/include/linux/libata.h linux-3.14.43/include/linux/libata.h
--- linux-3.14.43.org/include/linux/libata.h 2015-05-17 18:54:01.000000000 +0200
+++ linux-3.14.43/include/linux/libata.h 2015-07-11 19:13:03.190682173 +0200
@@ -421,6 +421,7 @@
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 << 22), /* don't use TRIM */
/* DMA mask for user DMA control: User visible values; DO NOT
renumber */