]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: nand: add generic READ RETRY support
authorBrian Norris <computersforpeace@gmail.com>
Fri, 3 Jan 2014 23:13:33 +0000 (15:13 -0800)
committerBrian Norris <computersforpeace@gmail.com>
Tue, 14 Jan 2014 07:12:58 +0000 (23:12 -0800)
commitf30a899b9c49da370cec6469c85136105f4a0586
treef800bac36e01b161b46f30bc308c963a81658d86
parent4fe1ae32b2fb1c19c44fda72039974d825ac9b91
mtd: nand: add generic READ RETRY support

Modern MLC (and even SLC?) NAND can experience a large number of
bitflips (beyond the recommended correctability capacity) due to drifts
in the voltage threshold (Vt). These bitflips can cause ECC errors to
occur well within the expected lifetime of the flash. To account for
this, some manufacturers provide a mechanism for shifting the Vt
threshold after a corrupted read.

The generic pattern seems to be that a particular flash has N read retry
modes (where N = 0, traditionally), and after an ECC failure, the host
should reconfigure the flash to use the next available mode, then retry
the read operation. This process repeats until all bitfips can be
corrected or until the host has tried all available retry modes.

This patch adds the infrastructure support for a
vendor-specific/flash-specific callback, used for setting the read-retry
mode (i.e., voltage threshold).

For now, this patch always returns the flash to mode 0 (the default
mode) after a successful read-retry, according to the flowchart found in
Micron's datasheets. This may need to change in the future if it is
determined that eventually, mode 0 is insufficient for the majority of
the flash cells (and so for performance reasons, we should leave the
flash in mode 1, 2, etc.).

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Huang Shijie <b32955@freescale.com>
drivers/mtd/nand/nand_base.c
include/linux/mtd/nand.h