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

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 <martin.petersen@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Martin K. Petersen and committed by
Tejun Heo
d7b16e4f 3b6eefc1

+4
+2
Documentation/kernel-parameters.txt
··· 1755 1755 1756 1756 * [no]ncq: Turn on or off NCQ. 1757 1757 1758 + * [no]ncqtrim: Turn off queued DSM TRIM. 1759 + 1758 1760 * nohrst, nosrst, norst: suppress hard, soft 1759 1761 and both resets. 1760 1762
+2
drivers/ata/libata-core.c
··· 6472 6472 { "3.0Gbps", .spd_limit = 2 }, 6473 6473 { "noncq", .horkage_on = ATA_HORKAGE_NONCQ }, 6474 6474 { "ncq", .horkage_off = ATA_HORKAGE_NONCQ }, 6475 + { "noncqtrim", .horkage_on = ATA_HORKAGE_NO_NCQ_TRIM }, 6476 + { "ncqtrim", .horkage_off = ATA_HORKAGE_NO_NCQ_TRIM }, 6475 6477 { "dump_id", .horkage_on = ATA_HORKAGE_DUMP_ID }, 6476 6478 { "pio0", .xfer_mask = 1 << (ATA_SHIFT_PIO + 0) }, 6477 6479 { "pio1", .xfer_mask = 1 << (ATA_SHIFT_PIO + 1) },