diff options
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r-- | drivers/ata/libata-core.c | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 5c84fb5c3372..d1a05f9bb91f 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -4233,10 +4233,33 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { | |||
4233 | { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER }, | 4233 | { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER }, |
4234 | 4234 | ||
4235 | /* devices that don't properly handle queued TRIM commands */ | 4235 | /* devices that don't properly handle queued TRIM commands */ |
4236 | { "Micron_M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, | 4236 | { "Micron_M[56]*", NULL, ATA_HORKAGE_NO_NCQ_TRIM | |
4237 | { "Crucial_CT???M500SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, | 4237 | ATA_HORKAGE_ZERO_AFTER_TRIM, }, |
4238 | { "Micron_M550*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, | 4238 | { "Crucial_CT*SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, |
4239 | { "Crucial_CT*M550SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, | 4239 | |
4240 | /* | ||
4241 | * As defined, the DRAT (Deterministic Read After Trim) and RZAT | ||
4242 | * (Return Zero After Trim) flags in the ATA Command Set are | ||
4243 | * unreliable in the sense that they only define what happens if | ||
4244 | * the device successfully executed the DSM TRIM command. TRIM | ||
4245 | * is only advisory, however, and the device is free to silently | ||
4246 | * ignore all or parts of the request. | ||
4247 | * | ||
4248 | * Whitelist drives that are known to reliably return zeroes | ||
4249 | * after TRIM. | ||
4250 | */ | ||
4251 | |||
4252 | /* | ||
4253 | * The intel 510 drive has buggy DRAT/RZAT. Explicitly exclude | ||
4254 | * that model before whitelisting all other intel SSDs. | ||
4255 | */ | ||
4256 | { "INTEL*SSDSC2MH*", NULL, 0, }, | ||
4257 | |||
4258 | { "INTEL*SSD*", NULL, ATA_HORKAGE_ZERO_AFTER_TRIM, }, | ||
4259 | { "SSD*INTEL*", NULL, ATA_HORKAGE_ZERO_AFTER_TRIM, }, | ||
4260 | { "Samsung*SSD*", NULL, ATA_HORKAGE_ZERO_AFTER_TRIM, }, | ||
4261 | { "SAMSUNG*SSD*", NULL, ATA_HORKAGE_ZERO_AFTER_TRIM, }, | ||
4262 | { "ST[1248][0248]0[FH]*", NULL, ATA_HORKAGE_ZERO_AFTER_TRIM, }, | ||
4240 | 4263 | ||
4241 | /* | 4264 | /* |
4242 | * Some WD SATA-I drives spin up and down erratically when the link | 4265 | * Some WD SATA-I drives spin up and down erratically when the link |
@@ -4748,7 +4771,10 @@ static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap) | |||
4748 | return NULL; | 4771 | return NULL; |
4749 | 4772 | ||
4750 | for (i = 0, tag = ap->last_tag + 1; i < max_queue; i++, tag++) { | 4773 | for (i = 0, tag = ap->last_tag + 1; i < max_queue; i++, tag++) { |
4751 | tag = tag < max_queue ? tag : 0; | 4774 | if (ap->flags & ATA_FLAG_LOWTAG) |
4775 | tag = i; | ||
4776 | else | ||
4777 | tag = tag < max_queue ? tag : 0; | ||
4752 | 4778 | ||
4753 | /* the last tag is reserved for internal command. */ | 4779 | /* the last tag is reserved for internal command. */ |
4754 | if (tag == ATA_TAG_INTERNAL) | 4780 | if (tag == ATA_TAG_INTERNAL) |