]> git.karo-electronics.de Git - karo-tx-linux.git/blob - Documentation/ABI/testing/sysfs-class-mtd
jfs: fix error path in ialloc
[karo-tx-linux.git] / Documentation / ABI / testing / sysfs-class-mtd
1 What:           /sys/class/mtd/
2 Date:           April 2009
3 KernelVersion:  2.6.29
4 Contact:        linux-mtd@lists.infradead.org
5 Description:
6                 The mtd/ class subdirectory belongs to the MTD subsystem
7                 (MTD core).
8
9 What:           /sys/class/mtd/mtdX/
10 Date:           April 2009
11 KernelVersion:  2.6.29
12 Contact:        linux-mtd@lists.infradead.org
13 Description:
14                 The /sys/class/mtd/mtd{0,1,2,3,...} directories correspond
15                 to each /dev/mtdX character device.  These may represent
16                 physical/simulated flash devices, partitions on a flash
17                 device, or concatenated flash devices.
18
19 What:           /sys/class/mtd/mtdXro/
20 Date:           April 2009
21 KernelVersion:  2.6.29
22 Contact:        linux-mtd@lists.infradead.org
23 Description:
24                 These directories provide the corresponding read-only device
25                 nodes for /sys/class/mtd/mtdX/ .
26
27 What:           /sys/class/mtd/mtdX/dev
28 Date:           April 2009
29 KernelVersion:  2.6.29
30 Contact:        linux-mtd@lists.infradead.org
31 Description:
32                 Major and minor numbers of the character device corresponding
33                 to this MTD device (in <major>:<minor> format).  This is the
34                 read-write device so <minor> will be even.
35
36 What:           /sys/class/mtd/mtdXro/dev
37 Date:           April 2009
38 KernelVersion:  2.6.29
39 Contact:        linux-mtd@lists.infradead.org
40 Description:
41                 Major and minor numbers of the character device corresponding
42                 to the read-only variant of thie MTD device (in
43                 <major>:<minor> format).  In this case <minor> will be odd.
44
45 What:           /sys/class/mtd/mtdX/erasesize
46 Date:           April 2009
47 KernelVersion:  2.6.29
48 Contact:        linux-mtd@lists.infradead.org
49 Description:
50                 "Major" erase size for the device.  If numeraseregions is
51                 zero, this is the eraseblock size for the entire device.
52                 Otherwise, the MEMGETREGIONCOUNT/MEMGETREGIONINFO ioctls
53                 can be used to determine the actual eraseblock layout.
54
55 What:           /sys/class/mtd/mtdX/flags
56 Date:           April 2009
57 KernelVersion:  2.6.29
58 Contact:        linux-mtd@lists.infradead.org
59 Description:
60                 A hexadecimal value representing the device flags, ORed
61                 together:
62
63                 0x0400: MTD_WRITEABLE - device is writable
64                 0x0800: MTD_BIT_WRITEABLE - single bits can be flipped
65                 0x1000: MTD_NO_ERASE - no erase necessary
66                 0x2000: MTD_POWERUP_LOCK - always locked after reset
67
68 What:           /sys/class/mtd/mtdX/name
69 Date:           April 2009
70 KernelVersion:  2.6.29
71 Contact:        linux-mtd@lists.infradead.org
72 Description:
73                 A human-readable ASCII name for the device or partition.
74                 This will match the name in /proc/mtd .
75
76 What:           /sys/class/mtd/mtdX/numeraseregions
77 Date:           April 2009
78 KernelVersion:  2.6.29
79 Contact:        linux-mtd@lists.infradead.org
80 Description:
81                 For devices that have variable eraseblock sizes, this
82                 provides the total number of erase regions.  Otherwise,
83                 it will read back as zero.
84
85 What:           /sys/class/mtd/mtdX/oobsize
86 Date:           April 2009
87 KernelVersion:  2.6.29
88 Contact:        linux-mtd@lists.infradead.org
89 Description:
90                 Number of OOB bytes per page.
91
92 What:           /sys/class/mtd/mtdX/size
93 Date:           April 2009
94 KernelVersion:  2.6.29
95 Contact:        linux-mtd@lists.infradead.org
96 Description:
97                 Total size of the device/partition, in bytes.
98
99 What:           /sys/class/mtd/mtdX/type
100 Date:           April 2009
101 KernelVersion:  2.6.29
102 Contact:        linux-mtd@lists.infradead.org
103 Description:
104                 One of the following ASCII strings, representing the device
105                 type:
106
107                 absent, ram, rom, nor, nand, dataflash, ubi, unknown
108
109 What:           /sys/class/mtd/mtdX/writesize
110 Date:           April 2009
111 KernelVersion:  2.6.29
112 Contact:        linux-mtd@lists.infradead.org
113 Description:
114                 Minimal writable flash unit size.  This will always be
115                 a positive integer.
116
117                 In the case of NOR flash it is 1 (even though individual
118                 bits can be cleared).
119
120                 In the case of NAND flash it is one NAND page (or a
121                 half page, or a quarter page).
122
123                 In the case of ECC NOR, it is the ECC block size.
124
125 What:           /sys/class/mtd/mtdX/ecc_strength
126 Date:           April 2012
127 KernelVersion:  3.4
128 Contact:        linux-mtd@lists.infradead.org
129 Description:
130                 Maximum number of bit errors that the device is capable of
131                 correcting within each region covering an ecc step.  This will
132                 always be a non-negative integer.  Note that some devices will
133                 have multiple ecc steps within each writesize region.
134
135                 In the case of devices lacking any ECC capability, it is 0.
136
137 What:           /sys/class/mtd/mtdX/bitflip_threshold
138 Date:           April 2012
139 KernelVersion:  3.4
140 Contact:        linux-mtd@lists.infradead.org
141 Description:
142                 This allows the user to examine and adjust the criteria by which
143                 mtd returns -EUCLEAN from mtd_read() and mtd_read_oob().  If the
144                 maximum number of bit errors that were corrected on any single
145                 region comprising an ecc step (as reported by the driver) equals
146                 or exceeds this value, -EUCLEAN is returned.  Otherwise, absent
147                 an error, 0 is returned.  Higher layers (e.g., UBI) use this
148                 return code as an indication that an erase block may be
149                 degrading and should be scrutinized as a candidate for being
150                 marked as bad.
151
152                 The initial value may be specified by the flash device driver.
153                 If not, then the default value is ecc_strength.
154
155                 The introduction of this feature brings a subtle change to the
156                 meaning of the -EUCLEAN return code.  Previously, it was
157                 interpreted to mean simply "one or more bit errors were
158                 corrected".  Its new interpretation can be phrased as "a
159                 dangerously high number of bit errors were corrected on one or
160                 more regions comprising an ecc step".  The precise definition of
161                 "dangerously high" can be adjusted by the user with
162                 bitflip_threshold.  Users are discouraged from doing this,
163                 however, unless they know what they are doing and have intimate
164                 knowledge of the properties of their device.  Broadly speaking,
165                 bitflip_threshold should be low enough to detect genuine erase
166                 block degradation, but high enough to avoid the consequences of
167                 a persistent return value of -EUCLEAN on devices where sticky
168                 bitflips occur.  Note that if bitflip_threshold exceeds
169                 ecc_strength, -EUCLEAN is never returned by the read operations.
170                 Conversely, if bitflip_threshold is zero, -EUCLEAN is always
171                 returned, absent a hard error.
172
173                 This is generally applicable only to NAND flash devices with ECC
174                 capability.  It is ignored on devices lacking ECC capability;
175                 i.e., devices for which ecc_strength is zero.