OSDN Git Service

libata: implement ATA_HORKAGE_MAX_TRIM_128M and apply to Sandisks
authorTejun Heo <tj@kernel.org>
Wed, 2 Sep 2020 16:32:45 +0000 (12:32 -0400)
committerJens Axboe <axboe@kernel.dk>
Wed, 2 Sep 2020 17:31:23 +0000 (11:31 -0600)
commit3b5455636fe26ea21b4189d135a424a6da016418
tree8658ea2acbc2338358ea2f86d1ad1d05c5c83c6d
parente276c9bd14c75278d1354efbaea278500147d6b3
libata: implement ATA_HORKAGE_MAX_TRIM_128M and apply to Sandisks

All three generations of Sandisk SSDs lock up hard intermittently.
Experiments showed that disabling NCQ lowered the failure rate significantly
and the kernel has been disabling NCQ for some models of SD7's and 8's,
which is obviously undesirable.

Karthik worked with Sandisk to root cause the hard lockups to trim commands
larger than 128M. This patch implements ATA_HORKAGE_MAX_TRIM_128M which
limits max trim size to 128M and applies it to all three generations of
Sandisk SSDs.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Karthik Shivaram <karthikgs@fb.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/ata/libata-core.c
drivers/ata/libata-scsi.c
include/linux/libata.h