Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-4.2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata

Pull libata fixes from Tejun Heo:
"A couple important fixes.

- A block layer change which removed restriction on max transfer size
led to silent data corruption on some devices. A new quirk is
added to restore the old size limit for the reported device. If it
gets reported on more devices, we might have to consider restoring
the restriction for ATA devices by default.

- There finally is a SSD which is confirmed to cause data corruption
on TRIM regardless of which flavor is used. A new quirk is added
and the device is blacklisted

- Other device-specific workarounds"

* 'for-4.2-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
libata: Do not blacklist M510DC
libata: increase the timeout when setting transfer mode
libata: add ATA_HORKAGE_MAX_SEC_1024 to revert back to previous max_sectors limit
libata: force disable trim for SuperSSpeed S238
libata: add ATA_HORKAGE_NOTRIM
libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for HP 250GB SATA disk VB0250EAVER
ata: pmp: add quirk for Marvell 4140 SATA PMP

+32 -4
+18 -3
drivers/ata/libata-core.c
··· 2478 2478 dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128, 2479 2479 dev->max_sectors); 2480 2480 2481 + if (dev->horkage & ATA_HORKAGE_MAX_SEC_1024) 2482 + dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_1024, 2483 + dev->max_sectors); 2484 + 2481 2485 if (dev->horkage & ATA_HORKAGE_MAX_SEC_LBA48) 2482 2486 dev->max_sectors = ATA_MAX_SECTORS_LBA48; 2483 2487 ··· 4150 4146 { "Slimtype DVD A DS8A8SH", NULL, ATA_HORKAGE_MAX_SEC_LBA48 }, 4151 4147 { "Slimtype DVD A DS8A9SH", NULL, ATA_HORKAGE_MAX_SEC_LBA48 }, 4152 4148 4149 + /* 4150 + * Causes silent data corruption with higher max sects. 4151 + * http://lkml.kernel.org/g/x49wpy40ysk.fsf@segfault.boston.devel.redhat.com 4152 + */ 4153 + { "ST380013AS", "3.20", ATA_HORKAGE_MAX_SEC_1024 }, 4154 + 4153 4155 /* Devices we expect to fail diagnostics */ 4154 4156 4155 4157 /* Devices where NCQ should be avoided */ ··· 4184 4174 { "ST3320[68]13AS", "SD1[5-9]", ATA_HORKAGE_NONCQ | 4185 4175 ATA_HORKAGE_FIRMWARE_WARN }, 4186 4176 4187 - /* Seagate Momentus SpinPoint M8 seem to have FPMDA_AA issues */ 4177 + /* drives which fail FPDMA_AA activation (some may freeze afterwards) */ 4188 4178 { "ST1000LM024 HN-M101MBB", "2AR10001", ATA_HORKAGE_BROKEN_FPDMA_AA }, 4189 4179 { "ST1000LM024 HN-M101MBB", "2BA30001", ATA_HORKAGE_BROKEN_FPDMA_AA }, 4180 + { "VB0250EAVER", "HPG7", ATA_HORKAGE_BROKEN_FPDMA_AA }, 4190 4181 4191 4182 /* Blacklist entries taken from Silicon Image 3124/3132 4192 4183 Windows driver .inf file - also several Linux problem reports */ ··· 4240 4229 ATA_HORKAGE_ZERO_AFTER_TRIM, }, 4241 4230 { "Crucial_CT*M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM | 4242 4231 ATA_HORKAGE_ZERO_AFTER_TRIM, }, 4243 - { "Micron_M5[15]0*", "MU01", ATA_HORKAGE_NO_NCQ_TRIM | 4232 + { "Micron_M5[15]0_*", "MU01", ATA_HORKAGE_NO_NCQ_TRIM | 4244 4233 ATA_HORKAGE_ZERO_AFTER_TRIM, }, 4245 4234 { "Crucial_CT*M550*", "MU01", ATA_HORKAGE_NO_NCQ_TRIM | 4246 4235 ATA_HORKAGE_ZERO_AFTER_TRIM, }, ··· 4248 4237 ATA_HORKAGE_ZERO_AFTER_TRIM, }, 4249 4238 { "Samsung SSD 8*", NULL, ATA_HORKAGE_NO_NCQ_TRIM | 4250 4239 ATA_HORKAGE_ZERO_AFTER_TRIM, }, 4240 + 4241 + /* devices that don't properly handle TRIM commands */ 4242 + { "SuperSSpeed S238*", NULL, ATA_HORKAGE_NOTRIM, }, 4251 4243 4252 4244 /* 4253 4245 * As defined, the DRAT (Deterministic Read After Trim) and RZAT ··· 4515 4501 else /* In the ancient relic department - skip all of this */ 4516 4502 return 0; 4517 4503 4518 - err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0); 4504 + /* On some disks, this command causes spin-up, so we need longer timeout */ 4505 + err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 15000); 4519 4506 4520 4507 DPRINTK("EXIT, err_mask=%x\n", err_mask); 4521 4508 return err_mask;
+7
drivers/ata/libata-pmp.c
··· 460 460 ATA_LFLAG_NO_SRST | 461 461 ATA_LFLAG_ASSUME_ATA; 462 462 } 463 + } else if (vendor == 0x11ab && devid == 0x4140) { 464 + /* Marvell 4140 quirks */ 465 + ata_for_each_link(link, ap, EDGE) { 466 + /* port 4 is for SEMB device and it doesn't like SRST */ 467 + if (link->pmp == 4) 468 + link->flags |= ATA_LFLAG_DISABLED; 469 + } 463 470 } 464 471 } 465 472
+2 -1
drivers/ata/libata-scsi.c
··· 2568 2568 rbuf[14] = (lowest_aligned >> 8) & 0x3f; 2569 2569 rbuf[15] = lowest_aligned; 2570 2570 2571 - if (ata_id_has_trim(args->id)) { 2571 + if (ata_id_has_trim(args->id) && 2572 + !(dev->horkage & ATA_HORKAGE_NOTRIM)) { 2572 2573 rbuf[14] |= 0x80; /* LBPME */ 2573 2574 2574 2575 if (ata_id_has_zero_after_trim(args->id) &&
+2
drivers/ata/libata-transport.c
··· 569 569 570 570 if (!ata_id_has_trim(ata_dev->id)) 571 571 mode = "unsupported"; 572 + else if (ata_dev->horkage & ATA_HORKAGE_NOTRIM) 573 + mode = "forced_unsupported"; 572 574 else if (ata_dev->horkage & ATA_HORKAGE_NO_NCQ_TRIM) 573 575 mode = "forced_unqueued"; 574 576 else if (ata_fpdma_dsm_supported(ata_dev))
+1
include/linux/ata.h
··· 45 45 ATA_SECT_SIZE = 512, 46 46 ATA_MAX_SECTORS_128 = 128, 47 47 ATA_MAX_SECTORS = 256, 48 + ATA_MAX_SECTORS_1024 = 1024, 48 49 ATA_MAX_SECTORS_LBA48 = 65535,/* TODO: 65536? */ 49 50 ATA_MAX_SECTORS_TAPE = 65535, 50 51
+2
include/linux/libata.h
··· 431 431 ATA_HORKAGE_WD_BROKEN_LPM = (1 << 21), /* some WDs have broken LPM */ 432 432 ATA_HORKAGE_ZERO_AFTER_TRIM = (1 << 22),/* guarantees zero after trim */ 433 433 ATA_HORKAGE_NO_NCQ_LOG = (1 << 23), /* don't use NCQ for log read */ 434 + ATA_HORKAGE_NOTRIM = (1 << 24), /* don't use TRIM */ 435 + ATA_HORKAGE_MAX_SEC_1024 = (1 << 25), /* Limit max sects to 1024 */ 434 436 435 437 /* DMA mask for user DMA control: User visible values; DO NOT 436 438 renumber */