The Micron/Crucial M500 SSDs exhibit incorrect protocol behavior when issuing queued TRIM commands, which could lead to silent data corruption. Disable issuance of queued TRIM commands for the affected drives. Signed-off-by: Marc Carino <marc.ceeeee@xxxxxxxxx> --- drivers/ata/libata-core.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index ff01584..715ba06 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -2152,6 +2152,13 @@ static int ata_dev_config_ncq(struct ata_device *dev, dev->flags |= ATA_DFLAG_NCQ_SEND_RECV; memcpy(dev->ncq_send_recv_cmds, ap->sector_buf, ATA_LOG_NCQ_SEND_RECV_SIZE); + + if (dev->horkage & ATA_HORKAGE_BROKEN_QUEUED_TRIM) { + ata_dev_dbg(dev, + "disabling queued TRIM support\n"); + dev->ncq_send_recv_cmds[ATA_LOG_NCQ_SEND_RECV_DSM_OFFSET] + &= ~ATA_LOG_NCQ_SEND_RECV_DSM_TRIM; + } } } @@ -4205,6 +4212,10 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { { "PIONEER DVD-RW DVR-212D", NULL, ATA_HORKAGE_NOSETXFER }, { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER }, + /* Devices that don't properly handle queued TRIM commands */ + { "Micron_M500*", NULL, ATA_HORKAGE_BROKEN_QUEUED_TRIM, }, + { "Crucial_CT???M500SSD1", NULL, ATA_HORKAGE_BROKEN_QUEUED_TRIM, }, + /* End Marker */ { } }; -- 1.8.1.3 -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html