aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-07-24 19:54:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-07-24 19:54:59 -0400
commit9fbf075c96fe09719f857c5abcf7b3138f5e0855 (patch)
tree85f0f81b601a2b109b4cc2741f062d45ccbe4bf8
parent1e63dca76a7458aeea7b2f7ecf93d8a9fe8d57b1 (diff)
parent9051bd393cf25e76dfb45409792719a854661500 (diff)
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
-rw-r--r--drivers/ata/libata-core.c21
-rw-r--r--drivers/ata/libata-pmp.c7
-rw-r--r--drivers/ata/libata-scsi.c3
-rw-r--r--drivers/ata/libata-transport.c2
-rw-r--r--include/linux/ata.h1
-rw-r--r--include/linux/libata.h2
6 files changed, 32 insertions, 4 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index e83fc3d0da9c..db5d9f79a247 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2478,6 +2478,10 @@ int ata_dev_configure(struct ata_device *dev)
2478 dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128, 2478 dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128,
2479 dev->max_sectors); 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 if (dev->horkage & ATA_HORKAGE_MAX_SEC_LBA48) 2485 if (dev->horkage & ATA_HORKAGE_MAX_SEC_LBA48)
2482 dev->max_sectors = ATA_MAX_SECTORS_LBA48; 2486 dev->max_sectors = ATA_MAX_SECTORS_LBA48;
2483 2487
@@ -4146,6 +4150,12 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
4146 { "Slimtype DVD A DS8A8SH", NULL, ATA_HORKAGE_MAX_SEC_LBA48 }, 4150 { "Slimtype DVD A DS8A8SH", NULL, ATA_HORKAGE_MAX_SEC_LBA48 },
4147 { "Slimtype DVD A DS8A9SH", NULL, ATA_HORKAGE_MAX_SEC_LBA48 }, 4151 { "Slimtype DVD A DS8A9SH", NULL, ATA_HORKAGE_MAX_SEC_LBA48 },
4148 4152
4153 /*
4154 * Causes silent data corruption with higher max sects.
4155 * http://lkml.kernel.org/g/x49wpy40ysk.fsf@segfault.boston.devel.redhat.com
4156 */
4157 { "ST380013AS", "3.20", ATA_HORKAGE_MAX_SEC_1024 },
4158
4149 /* Devices we expect to fail diagnostics */ 4159 /* Devices we expect to fail diagnostics */
4150 4160
4151 /* Devices where NCQ should be avoided */ 4161 /* Devices where NCQ should be avoided */
@@ -4174,9 +4184,10 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
4174 { "ST3320[68]13AS", "SD1[5-9]", ATA_HORKAGE_NONCQ | 4184 { "ST3320[68]13AS", "SD1[5-9]", ATA_HORKAGE_NONCQ |
4175 ATA_HORKAGE_FIRMWARE_WARN }, 4185 ATA_HORKAGE_FIRMWARE_WARN },
4176 4186
4177 /* Seagate Momentus SpinPoint M8 seem to have FPMDA_AA issues */ 4187 /* drives which fail FPDMA_AA activation (some may freeze afterwards) */
4178 { "ST1000LM024 HN-M101MBB", "2AR10001", ATA_HORKAGE_BROKEN_FPDMA_AA }, 4188 { "ST1000LM024 HN-M101MBB", "2AR10001", ATA_HORKAGE_BROKEN_FPDMA_AA },
4179 { "ST1000LM024 HN-M101MBB", "2BA30001", ATA_HORKAGE_BROKEN_FPDMA_AA }, 4189 { "ST1000LM024 HN-M101MBB", "2BA30001", ATA_HORKAGE_BROKEN_FPDMA_AA },
4190 { "VB0250EAVER", "HPG7", ATA_HORKAGE_BROKEN_FPDMA_AA },
4180 4191
4181 /* Blacklist entries taken from Silicon Image 3124/3132 4192 /* Blacklist entries taken from Silicon Image 3124/3132
4182 Windows driver .inf file - also several Linux problem reports */ 4193 Windows driver .inf file - also several Linux problem reports */
@@ -4229,7 +4240,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
4229 ATA_HORKAGE_ZERO_AFTER_TRIM, }, 4240 ATA_HORKAGE_ZERO_AFTER_TRIM, },
4230 { "Crucial_CT*M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM | 4241 { "Crucial_CT*M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM |
4231 ATA_HORKAGE_ZERO_AFTER_TRIM, }, 4242 ATA_HORKAGE_ZERO_AFTER_TRIM, },
4232 { "Micron_M5[15]0*", "MU01", ATA_HORKAGE_NO_NCQ_TRIM | 4243 { "Micron_M5[15]0_*", "MU01", ATA_HORKAGE_NO_NCQ_TRIM |
4233 ATA_HORKAGE_ZERO_AFTER_TRIM, }, 4244 ATA_HORKAGE_ZERO_AFTER_TRIM, },
4234 { "Crucial_CT*M550*", "MU01", ATA_HORKAGE_NO_NCQ_TRIM | 4245 { "Crucial_CT*M550*", "MU01", ATA_HORKAGE_NO_NCQ_TRIM |
4235 ATA_HORKAGE_ZERO_AFTER_TRIM, }, 4246 ATA_HORKAGE_ZERO_AFTER_TRIM, },
@@ -4238,6 +4249,9 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
4238 { "Samsung SSD 8*", NULL, ATA_HORKAGE_NO_NCQ_TRIM | 4249 { "Samsung SSD 8*", NULL, ATA_HORKAGE_NO_NCQ_TRIM |
4239 ATA_HORKAGE_ZERO_AFTER_TRIM, }, 4250 ATA_HORKAGE_ZERO_AFTER_TRIM, },
4240 4251
4252 /* devices that don't properly handle TRIM commands */
4253 { "SuperSSpeed S238*", NULL, ATA_HORKAGE_NOTRIM, },
4254
4241 /* 4255 /*
4242 * As defined, the DRAT (Deterministic Read After Trim) and RZAT 4256 * As defined, the DRAT (Deterministic Read After Trim) and RZAT
4243 * (Return Zero After Trim) flags in the ATA Command Set are 4257 * (Return Zero After Trim) flags in the ATA Command Set are
@@ -4501,7 +4515,8 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev)
4501 else /* In the ancient relic department - skip all of this */ 4515 else /* In the ancient relic department - skip all of this */
4502 return 0; 4516 return 0;
4503 4517
4504 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0); 4518 /* On some disks, this command causes spin-up, so we need longer timeout */
4519 err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 15000);
4505 4520
4506 DPRINTK("EXIT, err_mask=%x\n", err_mask); 4521 DPRINTK("EXIT, err_mask=%x\n", err_mask);
4507 return err_mask; 4522 return err_mask;
diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c
index 7ccc084bf1df..85aa76116a30 100644
--- a/drivers/ata/libata-pmp.c
+++ b/drivers/ata/libata-pmp.c
@@ -460,6 +460,13 @@ static void sata_pmp_quirks(struct ata_port *ap)
460 ATA_LFLAG_NO_SRST | 460 ATA_LFLAG_NO_SRST |
461 ATA_LFLAG_ASSUME_ATA; 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
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 3131adcc1f87..641a61a59e89 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -2568,7 +2568,8 @@ static unsigned int ata_scsiop_read_cap(struct ata_scsi_args *args, u8 *rbuf)
2568 rbuf[14] = (lowest_aligned >> 8) & 0x3f; 2568 rbuf[14] = (lowest_aligned >> 8) & 0x3f;
2569 rbuf[15] = lowest_aligned; 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 rbuf[14] |= 0x80; /* LBPME */ 2573 rbuf[14] |= 0x80; /* LBPME */
2573 2574
2574 if (ata_id_has_zero_after_trim(args->id) && 2575 if (ata_id_has_zero_after_trim(args->id) &&
diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c
index d6c37bcd416d..e2d94972962d 100644
--- a/drivers/ata/libata-transport.c
+++ b/drivers/ata/libata-transport.c
@@ -569,6 +569,8 @@ show_ata_dev_trim(struct device *dev,
569 569
570 if (!ata_id_has_trim(ata_dev->id)) 570 if (!ata_id_has_trim(ata_dev->id))
571 mode = "unsupported"; 571 mode = "unsupported";
572 else if (ata_dev->horkage & ATA_HORKAGE_NOTRIM)
573 mode = "forced_unsupported";
572 else if (ata_dev->horkage & ATA_HORKAGE_NO_NCQ_TRIM) 574 else if (ata_dev->horkage & ATA_HORKAGE_NO_NCQ_TRIM)
573 mode = "forced_unqueued"; 575 mode = "forced_unqueued";
574 else if (ata_fpdma_dsm_supported(ata_dev)) 576 else if (ata_fpdma_dsm_supported(ata_dev))
diff --git a/include/linux/ata.h b/include/linux/ata.h
index fed36418dd1c..6c78956aa470 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -45,6 +45,7 @@ enum {
45 ATA_SECT_SIZE = 512, 45 ATA_SECT_SIZE = 512,
46 ATA_MAX_SECTORS_128 = 128, 46 ATA_MAX_SECTORS_128 = 128,
47 ATA_MAX_SECTORS = 256, 47 ATA_MAX_SECTORS = 256,
48 ATA_MAX_SECTORS_1024 = 1024,
48 ATA_MAX_SECTORS_LBA48 = 65535,/* TODO: 65536? */ 49 ATA_MAX_SECTORS_LBA48 = 65535,/* TODO: 65536? */
49 ATA_MAX_SECTORS_TAPE = 65535, 50 ATA_MAX_SECTORS_TAPE = 65535,
50 51
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 36ce37bcc963..c9cfbcdb8d14 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -431,6 +431,8 @@ enum {
431 ATA_HORKAGE_WD_BROKEN_LPM = (1 << 21), /* some WDs have broken LPM */ 431 ATA_HORKAGE_WD_BROKEN_LPM = (1 << 21), /* some WDs have broken LPM */
432 ATA_HORKAGE_ZERO_AFTER_TRIM = (1 << 22),/* guarantees zero after trim */ 432 ATA_HORKAGE_ZERO_AFTER_TRIM = (1 << 22),/* guarantees zero after trim */
433 ATA_HORKAGE_NO_NCQ_LOG = (1 << 23), /* don't use NCQ for log read */ 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 /* DMA mask for user DMA control: User visible values; DO NOT 437 /* DMA mask for user DMA control: User visible values; DO NOT
436 renumber */ 438 renumber */