aboutsummaryrefslogtreecommitdiff
path: root/nandtest.c
AgeCommit message (Collapse)Author
2014-09-08nandtest: fix --reads argumentGuido Martínez
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>
2014-05-30nandtest: Introduce multiple reads & check iterationsEzequiel García
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>
2014-05-05nandtest: Move the "read and compare" code to a functionEzequiel Garcia
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>
2014-05-05nandtest: Remove redundant checkEzequiel Garcia
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>
2013-07-01nand{dump, test, write}: clean up --help handlingMike Frysinger
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>
2013-07-01move _GNU_SOURCE to the main makefileMike Frysinger
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>
2011-12-05nandtest: seed random generator with timeBrian Norris
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>
2011-12-01nandtest: use seed argumentJan Weitzel
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>
2011-12-01nandtest: set oldstats.failedJan Weitzel
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>
2011-08-25nandtest: print number of bits corrected during testBen Gardiner
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>
2011-06-29mtd-utils: remove whitespace at end of linesBrian Norris
Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2010-09-27mtd-utils: standardize PROGRAM_NAMEMike Frysinger
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>
2010-07-30mtd-utils: clean up compile warningsKevin Cernekee
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>
2010-07-18nandtest: Fixed indentationBrian Norris
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>
2010-03-31nandtest: fix --keep argumentRadoslav Kolev
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>
2007-09-11Improve option handling in nandtest, add markbad and offset/length options.David Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-08-10Mark blocks bad on failed write; don't abort.David Woodhouse
2007-08-09Fix repeated warning about ECC correction, in nandtestDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-08-09Add nand integrity testing utility.David Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org>