aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorMike Dunn <mikedunn@newsguy.com>2012-04-25 15:06:08 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-05-14 00:11:39 -0400
commitd062d4ede877fcd2ecc4c6262abad09a6f32950a (patch)
tree320869428d5aef43b803c4a8131140aabb21c8fb /Documentation
parenta9b672e82bca47bf2b37ee869b8095000cf3ca88 (diff)
mtd: bitflip_threshold added to mtd_info and sysfs
An element 'bitflip_threshold' is added to struct mtd_info, and also exposed as a read/write variable in sysfs. This will be used to determine whether or not mtd_read() returns -EUCLEAN or 0 (absent a hard error). If the driver leaves it as zero, mtd will set it to a default value of ecc_strength. This v2 adds the line that propagates bitflip_threshold from the master to the partitions - thanks Ivan¹. ¹ http://lists.infradead.org/pipermail/linux-mtd/2012-April/040900.html Signed-off-by: Mike Dunn <mikedunn@newsguy.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/ABI/testing/sysfs-class-mtd36
1 files changed, 36 insertions, 0 deletions
diff --git a/Documentation/ABI/testing/sysfs-class-mtd b/Documentation/ABI/testing/sysfs-class-mtd
index 43d18180b46e..78835080856a 100644
--- a/Documentation/ABI/testing/sysfs-class-mtd
+++ b/Documentation/ABI/testing/sysfs-class-mtd
@@ -135,3 +135,39 @@ Description:
135 have multiple ecc steps within each writesize region. 135 have multiple ecc steps within each writesize region.
136 136
137 In the case of devices lacking any ECC capability, it is 0. 137 In the case of devices lacking any ECC capability, it is 0.
138
139What: /sys/class/mtd/mtdX/bitflip_threshold
140Date: April 2012
141KernelVersion: 3.4
142Contact: linux-mtd@lists.infradead.org
143Description:
144 This allows the user to examine and adjust the criteria by which
145 mtd returns -EUCLEAN from mtd_read(). If the maximum number of
146 bit errors that were corrected on any single region comprising
147 an ecc step (as reported by the driver) equals or exceeds this
148 value, -EUCLEAN is returned. Otherwise, absent an error, 0 is
149 returned. Higher layers (e.g., UBI) use this return code as an
150 indication that an erase block may be degrading and should be
151 scrutinized as a candidate for being marked as bad.
152
153 The initial value may be specified by the flash device driver.
154 If not, then the default value is ecc_strength.
155
156 The introduction of this feature brings a subtle change to the
157 meaning of the -EUCLEAN return code. Previously, it was
158 interpreted to mean simply "one or more bit errors were
159 corrected". Its new interpretation can be phrased as "a
160 dangerously high number of bit errors were corrected on one or
161 more regions comprising an ecc step". The precise definition of
162 "dangerously high" can be adjusted by the user with
163 bitflip_threshold. Users are discouraged from doing this,
164 however, unless they know what they are doing and have intimate
165 knowledge of the properties of their device. Broadly speaking,
166 bitflip_threshold should be low enough to detect genuine erase
167 block degradation, but high enough to avoid the consequences of
168 a persistent return value of -EUCLEAN on devices where sticky
169 bitflips occur. Note that if bitflip_threshold exceeds
170 ecc_strength, -EUCLEAN is never returned by the read functions.
171
172 This is generally applicable only to NAND flash devices with ECC
173 capability. It is ignored on devices lacking ECC capability.