From d7b16e4f6283c6ec52b411aa6deb02ca4d030d20 Mon Sep 17 00:00:00 2001 From: "Martin K. Petersen" Date: Mon, 4 May 2015 21:54:18 -0400 Subject: libata: Allow NCQ TRIM to be enabled or disabled with a module parameter We have started seeing SSD firmware updates introduce support for queued TRIM. Sadly, in most cases this support is completely untested and can lead to either errors or data corruption. Add two libata force flags that can be used to either enable or disable queued TRIM support. Signed-off-by: Martin K. Petersen Reviewed-by: Hannes Reinecke Signed-off-by: Tejun Heo --- drivers/ata/libata-core.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/ata/libata-core.c') diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index f6cb1f1b30b7..8c1f0742cc1a 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -6472,6 +6472,8 @@ static int __init ata_parse_force_one(char **cur, { "3.0Gbps", .spd_limit = 2 }, { "noncq", .horkage_on = ATA_HORKAGE_NONCQ }, { "ncq", .horkage_off = ATA_HORKAGE_NONCQ }, + { "noncqtrim", .horkage_on = ATA_HORKAGE_NO_NCQ_TRIM }, + { "ncqtrim", .horkage_off = ATA_HORKAGE_NO_NCQ_TRIM }, { "dump_id", .horkage_on = ATA_HORKAGE_DUMP_ID }, { "pio0", .xfer_mask = 1 << (ATA_SHIFT_PIO + 0) }, { "pio1", .xfer_mask = 1 << (ATA_SHIFT_PIO + 1) }, -- cgit v1.2.1 From 8485187b5e458d17d63a597484391b98bbcdbb7b Mon Sep 17 00:00:00 2001 From: Masanari Iida Date: Fri, 29 May 2015 23:11:51 +0900 Subject: Doc: libata: Fix spelling typo found in libata.xml This patch fix a spelling typo found in libata.xml. It is because libata.xml is generated from comments in source, I have to fix it in libata-core.c Signed-off-by: Masanari Iida Signed-off-by: Tejun Heo --- drivers/ata/libata-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/ata/libata-core.c') diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 8c1f0742cc1a..52c640da9d4e 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -3654,7 +3654,7 @@ int sata_link_resume(struct ata_link *link, const unsigned long *params, * EH context. * * RETURNS: - * 0 on succes, -errno otherwise. + * 0 on success, -errno otherwise. */ int sata_link_scr_lpm(struct ata_link *link, enum ata_lpm_policy policy, bool spm_wakeup) -- cgit v1.2.1 From 0f5f264b38122b39cfa0beb65eef6b5ccac94917 Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Tue, 9 Jun 2015 15:33:19 +0200 Subject: libata: finally use __initconst in ata_parse_force_one() Just six days after this FIXME was added seven years ago, Sam Ravnborg added the missing feature (37c514e3dfc8 "Add missing init section definitions"), though it ended up being called __initconst. Let's use it; better late than never. Signed-off-by: Rasmus Villemoes Signed-off-by: Tejun Heo --- drivers/ata/libata-core.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'drivers/ata/libata-core.c') diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 52c640da9d4e..86052e88b65c 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -6456,12 +6456,7 @@ static int __init ata_parse_force_one(char **cur, struct ata_force_ent *force_ent, const char **reason) { - /* FIXME: Currently, there's no way to tag init const data and - * using __initdata causes build failure on some versions of - * gcc. Once __initdataconst is implemented, add const to the - * following structure. - */ - static struct ata_force_param force_tbl[] __initdata = { + static const struct ata_force_param force_tbl[] __initconst = { { "40c", .cbl = ATA_CBL_PATA40 }, { "80c", .cbl = ATA_CBL_PATA80 }, { "short40c", .cbl = ATA_CBL_PATA40_SHORT }, -- cgit v1.2.1 From 243918be6393f643e513a26e7882e6ae06ff7717 Mon Sep 17 00:00:00 2001 From: "Martin K. Petersen" Date: Thu, 18 Jun 2015 14:50:18 -0400 Subject: libata: Do not blacklist Micron M500DC Queued TRIM got disabled on Micron M500DC drives thanks to the "Micron_M500*" pattern we had in place to accommodate the previous generation of this drive family. Tweak the blacklist entry slightly so we only disable queued TRIM for the non-DC variants of M500 drives. Signed-off-by: Martin K. Petersen Cc: stable@vger.kernel.org Signed-off-by: Tejun Heo --- drivers/ata/libata-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/ata/libata-core.c') diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 86052e88b65c..0ed3cb8c0f36 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -4225,7 +4225,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER }, /* devices that don't properly handle queued TRIM commands */ - { "Micron_M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM | + { "Micron_M500_*", NULL, ATA_HORKAGE_NO_NCQ_TRIM | ATA_HORKAGE_ZERO_AFTER_TRIM, }, { "Crucial_CT*M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM | ATA_HORKAGE_ZERO_AFTER_TRIM, }, -- cgit v1.2.1