Age | Commit message (Collapse) | Author |
|
* There is no code modification in this commit, only moving
* the files to proper place.
The user tools looks a little messy as we place almost
the all tools in the root directory of mtd-utils. To make
it more clear, I propose to introduce the following structure
for our source code.
mtd-utils/
|-- lib
|-- include
|-- misc-utils
|-- jffsX-utils
|-- nand-utils
|-- nor-utils
|-- ubi-utils
|-- ubifs-utils
`-- tests
Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
|
|
These two options are handled inconsistently, which caused an
unnecessary amount of head scratching. Let's just use the simple helpers
too, so we get the error handling right.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
|
|
The --reads option specifies the argument as optional, but doesn't check
for a null optarg, which means that nandtest segfaults when run as
"nandtest --reads".
Fix this by making the argument required, and changing the help text to
not specify it as optional. Argument -r already specifies the argument
as required, so we fix this inconsistency too.
Signed-off-by: Guido Martínez <guido@vanguardiasur.com.ar>
Acked-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
|
|
The current nandtest performs a simple test which consists of:
1. erase block
2. write data
3. read and verify
In order to improve the nandtest strength, this commit adds a new parameter
to increase the number of "read and verify" iterations. In other words,
the test now consists of:
1. erase block
2. write data
3. read and verify (N times)
This seem to apply more pressure on a NAND driver's ECC engine and has been
used to discover stability problems with an old OMAP2.
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Acked-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
|
|
This commit makes no functionality change, and simply moves the
read and compare code into a separate read_and_compare() function.
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
|
|
This commit removes a redundant 'len' check, which is already performed
just after the pread call.
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
|
|
We should send the output to stdout when the user passes -h/--help
and then exit(0), but otherwise the output should go to stderr and
then exit(1).
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
|
|
A bunch of utils are relying on _GNU_SOURCE already. The new prompt code
uses getline() which is now part of POSIX, but in older versions of glibc,
it was behind _GNU_SOURCE as it was a GNU extension.
This change doesn't actually tie us to glibc. Only code that uses GNU
extensions does that. It just kills warning when using older versions of
glibc.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
|
|
If a seed is not provided via --seed, we use the default rand() values,
which produces the same sequence of values every run. Since this is
undesirable, we should choose a random seed via the current time().
Note that this patch moves the srand() until after all the initial
options processing.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@intel.com>
|
|
if a seed is provided it is actually not used. First call is
"seed = rand()" killing the given seed.
Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Tested-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@intel.com>
|
|
if new ecc failed occures oldstats.corrected is updated not oldstats.failed
Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@intel.com>
|
|
The nandtest program monitors the corrected ecc stat to determine if an
ECC correction has taken place during the last write-read. If so, it
prints "ECC corrected".
The mtd subsytem will store the number of bits corrected in the corrected
ecc stat so update the nandtest output to print also the number of bits
corrected when performing the test.
Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
|
|
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
|
|
Make sure all the utils define PROGRAM_NAME and do so at the start of
the file so that sub-headers may assume it exists.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
gcc 4.4.3 on x86_64:
libcrc32.c:42: warning: ‘static’ is not at beginning of declaration
libfec.c:120: warning: initialization discards qualifiers from pointer target type
libfec.c:121: warning: initialization discards qualifiers from pointer target type
libfec.c:417: warning: passing argument 2 of ‘my_malloc’ discards qualifiers from pointer target type
recv_image.c:164: warning: comparison of unsigned expression < 0 is always false
recv_image.c:170: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘size_t’
recv_image.c:170: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘long unsigned int’
And many more along the same lines.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Replaced tabs with spaces in the help message for nandtest to
fix problems with varying indentation and to provide consistency
with other utils in the set.
Signed-off-by: Brian Norris <norris@broadcom.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
When called with the --keep argument nandtest is supposed to restore the
original content after testing, but currently it doesn't. The patch
below fixes the problem.
Signed-off-by: Radoslav Kolev <radoslav.kolev@rnd.bg>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
|
|
|
|
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
|
|
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
|