Patch "libata: add ATA_HORKAGE_MAX_SEC_1024 to revert back to previous max_sectors limit" has been added to the 4.1-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
libata: add ATA_HORKAGE_MAX_SEC_1024 to revert back to previous max_sectors limit
to the 4.1-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
libata-add-ata_horkage_max_sec_1024-to-revert-back-to-previous-max_sectors-limit.patch
and it can be found in the queue-4.1 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
af34d637637eabaf49406eb35c948cd51ba262a6Mon Sep 17 00:00:00 2001
From: David Milburn <[email protected]>
Date: Mon, 13 Jul 2015 11:48:23 -0500
Subject: libata: add ATA_HORKAGE_MAX_SEC_1024 to revert back to previous max_sectors limit
From: David Milburn <[email protected]>
commit af34d637637eabaf49406eb35c948cd51ba262a6 upstream.
Since no longer limiting max_sectors to BLK_DEF_MAX_SECTORS (commit 34b48db66e08), data corruption may occur on ST380013AS drive configured on 82801JI (ICH10 Family) SATA controller. This patch will allow the driver to limit max_sectors as before
# cat /sys/block/sdb/queue/max_sectors_kb 512
I was able to double the max_sectors_kb value up to 16384 on linux-4.2.0-rc2 before seeing corruption, but seems safer to use previous limit. Without this patch max_sectors_kb will be 32767.
tj: Minor comment update.
--- drivers/ata/libata-core.c | 10 ++++++++++ include/linux/ata.h | 1 + include/linux/libata.h | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-)
drivers/ata/libata-core.c +10 -0
@@ -2478,6 +2478,10 @@ int ata_dev_configure(struct ata_device dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128, dev->max_sectors); +if (dev->horkage &ATA_HORKAGE_MAX_SEC_1024 ) + dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_1024, + dev->max_sectors); +if (dev->horkage &ATA_HORKAGE_MAX_SEC_LBA48 ) dev->max_sectors =ATA_MAX_SECTORS_LBA48 ;
@@ -4146,6 +4150,12 @@ static const struct ata_blacklist_entry { "Slimtype DVD A DS8A8SH", NULL, ATA_HORKAGE_MAX_SEC_LBA48 }, { "Slimtype DVD A DS8A9SH", NULL, ATA_HORKAGE_MAX_SEC_LBA48 }, +/* +* Causes silent data corruption with higher max sects. +* http://lkml.kernel.org/g/[email protected] +*/ + { "ST380013AS", "3.20", ATA_HORKAGE_MAX_SEC_1024 }, +/* Devices we expect to fail diagnostics */ /* Devices where NCQ should be avoided */
include/linux/ata.h +1 -0
@@ -45,6 +45,7 @@ enum {ATA_SECT_SIZE =512 ,ATA_MAX_SECTORS_128 =128 ,ATA_MAX_SECTORS =256 , +ATA_MAX_SECTORS_1024 =1024 ,ATA_MAX_SECTORS_LBA48 =65535 ,/* TODO: 65536? */ ATA_MAX_SECTORS_TAPE = 65535,
include/linux/libata.h +1 -1
@@ -433,7 +433,7 @@ enum {ATA_HORKAGE_ZERO_AFTER_TRIM = (1 <<22 ),/* guarantees zero after trim */ ATA_HORKAGE_NO_NCQ_LOG = (1 <<23 ),/* don't use NCQ for log read */ ATA_HORKAGE_NOTRIM = (1 <<24 ),/* don't use TRIM */ - + ATA_HORKAGE_MAX_SEC_1024 = (1 << 25), /* Limit max sects to 1024 *//* DMA mask for user DMA control: User visible values; DO NOT renumber */
Patches currently in stable-queue which might be from [email protected] are
queue-4.1/libata-add-ata_horkage_max_sec_1024-to-revert-back-to-previous-max_sectors-limit.patch