aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/tests (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-02-27mtd: mtd_oobtest: convert to use prandom libraryAkinobu Mita1-33/+16
This removes home-brewed pseudo-random number generator and use prandom library. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Artem Bityutskiy <dedekind1@gmail.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: "Theodore Ts'o" <tytso@mit.edu> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Laight <david.laight@aculab.com> Cc: Eilon Greenstein <eilong@broadcom.com> Cc: Michel Lespinasse <walken@google.com> Cc: Robert Love <robert.w.love@intel.com> Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-02-27mtd: mtd_nandecctest: use prandom_bytes instead of get_random_bytes()Akinobu Mita1-1/+1
Using prandom_bytes() is enough. Because this data is only used for testing, not used for cryptographic use. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Artem Bityutskiy <dedekind1@gmail.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: "Theodore Ts'o" <tytso@mit.edu> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Laight <david.laight@aculab.com> Cc: Eilon Greenstein <eilong@broadcom.com> Cc: Michel Lespinasse <walken@google.com> Cc: Robert Love <robert.w.love@intel.com> Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-02-13mtd: mtd_torturetest can cause stack overflowsAl Cooper1-14/+11
mtd_torturetest uses the module parm "ebcnt" to control the size of a stack based array of int's. When "ebcnt" is large, Ex: 1000, it causes stack overflows on systems with small kernel stacks. The fix is to move the array from the stack to kmalloc memory. Signed-off-by: Al Cooper <alcooperx@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2013-02-04mtd: rename random32() to prandom_u32()Akinobu Mita2-9/+9
Use more preferable function name which implies using a pseudo-random number generator. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-12-04mtd: tests/read: initialize buffer for whole next pageChristian Herzig1-1/+1
fix: do block-buffer initialize for the whole next page to zero. Signed-off-by: Christian Herzig <christian.herzig@keymile.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-11-18mtd: Fix typo mtd/testsMasanari Iida7-8/+8
Correct spelling typo in printk within drivers/mtd/tests. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-11-15mtd: mtd_oobtest: printk -> pr_{info,err,crit}Vikram Narayanan1-87/+84
Use pr_info() and pr_err() while defining pr_fmt(). This saves a few characters, joins a few lines, and makes the code a little more readable (and grep-able). Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Vikram Narayanan <vikram186@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-11-15mtd: tests: mtd_torturetest: Replace printk with pr_{info,crit}Vikram Narayanan1-36/+37
Use pr_fmt instead of PRINT_PREF macro Signed-off-by: Vikram Narayanan <vikram186@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-11-15mtd: tests: mtd_subpagetest: replace printk with pr_{info,crit,err}Vikram Narayanan1-62/+62
Use pr_fmt instead of PRINT_PREF macro Signed-off-by: Vikram Narayanan <vikram186@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-11-15mtd: tests: mtd_speedtest: Replace printk with pr_{info,crit,err}Vikram Narayanan1-44/+44
Use pr_fmt instead of PRINT_PREF macro Signed-off-by: Vikram Narayanan <vikram186@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-11-15mtd: tests: mtd_stresstest: Replace printk with pr_{info,crit,err}Vikram Narayanan1-22/+22
Use pr_fmt instead of PRINT_PREF macro Signed-off-by: Vikram Narayanan <vikram186@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-11-15mtd: tests: mtd_readtest: Replace printk with pr_{info,err}Vikram Narayanan1-21/+21
Use pr_fmt instead of PRINT_PREF macro Signed-off-by: Vikram Narayanan <vikram186@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-11-15mtd: tests: mtd_pagetest: Replace printk with pr_{info,crit,err}Vikram Narayanan1-76/+76
Use pr_fmt instead of PRINT_PREF macro Signed-off-by: Vikram Narayanan <vikram186@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-11-15mtd: tests: mtd_nandecctest: Use pr_fmt macroVikram Narayanan1-2/+4
Use KBUILD_MODNAME instead of hardcoding the filename Signed-off-by: Vikram Narayanan <vikram186@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-11-15mtd: tests: mtd_nandbiterrs: replace msg macro with pr_{info,err}Vikram Narayanan1-36/+37
Use pr_fmt instead of msg macro Signed-off-by: Vikram Narayanan <vikram186@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-09-29mtd: mtd_nandecctest: add double bit error detection testsAkinobu Mita1-0/+79
This adds the double bit error detection test cases listed below: * Prepare data block with double bit error and ECC data without corruption, and verify that the uncorrectable error is detected by __nand_correct_data(). * Prepare data block with single bit error and ECC data with single bit error, and verify that the uncorrectable error is detected. * Prepare data block without corruption and ECC data with double bit error, and verify that the uncorrectable error is detected. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-09-29mtd: mtd_nandecctest: add single bit error correction testAkinobu Mita1-0/+37
This adds the single bit error correction test case listed below: Prepare data block without corruption and ECC data with single bit error, and verify that the data block is preserved by __nand_correct_data(). Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-09-29mtd: mtd_nandecctest: add no corruption testAkinobu Mita1-0/+26
This adds no corruptin test case listed below: Prepare data block and ECC data with no corruption, and verify that the data block is preserved by __nand_correct_data() Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-09-29mtd: mtd_nandecctest: rewrite the test routineAkinobu Mita1-23/+70
This rewrites the entire test routine in order to make it easy to add more tests by later changes and minimize duplication of each tests as much as possible. Now that each test is described by the members of struct nand_ecc_test: - name: descriptive testname - prepare: function to prepare data block and ecc with artifical corruption - verify: function to verify the result of correcting data block Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-09-29mtd: mtd_nandecctest: support injecting bit error for ecc codeAkinobu Mita1-2/+16
Currently inject_single_bit_error() is used to inject single bit error into randomly selected bit position of the 256 or 512 bytes data block. Later change will add tests which inject bit errors into the ecc code. Unfortunately, inject_single_bit_error() doesn't work for the ecc code which is not a multiple of sizeof(unsigned long). Because bit fliping at random position is done by __change_bit(). For example, flipping bit position 0 by __change_bit(0, addr) modifies 3rd byte (32bit) or 7th byte (64bit) on big-endian systems. Using little-endian version of bitops can fix this issue. But little-endian version of __change_bit is not yet available. So this defines __change_bit_le() locally in a similar fashion to asm-generic/bitops/le.h and use it. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-09-29mtd: tests: test for multi-bit error correctionIwo Mergler2-0/+461
This tests ECC biterror recovery on a single NAND page. Mostly intended to test ECC hardware and low-level NAND driver. There are two test modes: 0 - artificially inserting bit errors until the ECC fails This is the default method and fairly quick. It should be independent of the quality of the FLASH. 1 - re-writing the same pattern repeatedly until the ECC fails. This method relies on the physics of NAND FLASH to eventually generate '0' bits if '1' has been written sufficient times. Depending on the NAND, the first bit errors will appear after 1000 or more writes and then will usually snowball, reaching the limits of the ECC quickly. The test stops after 10000 cycles, should your FLASH be exceptionally good and not generate bit errors before that. Try a different page offset in that case. Please note that neither of these tests will significantly 'use up' any FLASH endurance. Only a maximum of two erase operations will be performed. Signed-off-by: Iwo Mergler <Iwo.Mergler@netcommwireless.com.au> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-09-29mtd: mtd_nandecctest: ensure alignment requirement for bitopsAkinobu Mita1-14/+29
Currently the data blocks which is used to test single bit error correction is allocated statically and injecting single bit error is implemented by using __change_bit() which must operate on the memory aligned to the size of an "unsigned long". But there is no such guarantee for statically allocated array. This fix the issue by allocating the data block dynamically by kmalloc(). It also allocate the ecc code dynamically instead of allocating statically on stack. The reason to allocate the ecc code dynamically is that later change will add tests which inject bit errors into the ecc code by bitops. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-09-29mtd: mtd_nandecctest: improve message outputAkinobu Mita1-19/+29
This includes the message related changes: - Use pr_* instead of printk - Print hexdump of ECC code if test fails - Change log level for hexdump of data from KERN_DEBUG to KERN_INFO - Factor out the hexdump code into a separate function Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-09-29mtd: mtd_nandecctest: make module_init() return appropriate errnoAkinobu Mita1-1/+1
Return -EINVAL instead of -1 (-EPERM) when test fails. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-09-29mtd: mtd_nandecctest: remove unnecessary includeAkinobu Mita1-1/+0
Including linux/jiffies.h was required for calling srandom32(jiffies) that has already been removed. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-09-29mtd: mtd_nandecctest: make module_init() return an error code if test failsAkinobu Mita1-3/+6
Return an error code if test fails in order to detect a test case failure by invoking tests repeatedly like this: while sudo modprobe mtd_nandecctest; do sudo modprobe -r mtd_nandecctest done Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-09-29mtd: mtd_nandecctest: remove unnecessary srandom32() callAkinobu Mita1-2/+0
It is unnecessary for this driver to call srandom32() in module_init. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-07-06mtd: tests: use random32 instead of home-brewed generatorArtem Bityutskiy2-44/+11
This is a clean-up patch which removes the own pseudo-random numbers generator from the speed- and stress-tests and makes them use the 'random32()' generator instead. [dwmw2: Merge later fix for negative offsets] Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_can_have_bb helperArtem Bityutskiy4-7/+4
This patch introduces new 'mtd_can_have_bb()' helper function which checks whether the flash can have bad eraseblocks. Then it changes all the direct 'mtd->block_isbad' use cases with 'mtd_can_have_bb()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: remove extra retlen assignmentArtem Bityutskiy6-32/+21
MTD functions always assign the 'retlen' argument to 0 at the very beginning - the callers do not have to do this. I used the following semantic patch to find these places: @@ identifier retlen; expression a, b, c, d, e; constant C; type T; @@ ( - retlen = C; | T -retlen = C + retlen ; ) ... when != retlen when exists ( mtd_read(a, b, c, &retlen, d) | mtd_write(a, b, c, &retlen, d) | mtd_panic_write(a, b, c, &retlen, d) | mtd_point(a, b, c, &retlen, d, e) | mtd_read_fact_prot_reg(a, b, c, &retlen, d) | mtd_write_user_prot_reg(a, b, c, &retlen, d) | mtd_read_user_prot_reg(a, b, c, &retlen, d) | mtd_writev(a, b, c, d, &retlen) ) I ran it twice, because there were cases of double zero assigments in mtd tests. Then I went through the patch to verify that spatch did not find any false positives. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_block_isbad interfaceArtem Bityutskiy7-8/+7
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_write_oob interfaceArtem Bityutskiy1-5/+5
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_read_oob interfaceArtem Bityutskiy2-8/+8
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_write interfaceArtem Bityutskiy5-13/+13
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_read interfaceArtem Bityutskiy6-25/+25
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_erase interfaceArtem Bityutskiy6-7/+7
This patch is part of a patch-set which changes the MTD interface from 'mtd->func()' form to 'mtd_func()' form. We need this because we want to add common code to to all drivers in the mtd core level, which is impossible with the current interface when MTD clients call driver functions like 'read()' or 'write()' directly. At this point we just introduce a new inline wrapper function, but later some of them are expected to gain more code. E.g., the input parameters check should be moved to the wrappers rather than be duplicated at many drivers. This particular patch introduced the 'mtd_erase()' interface. The following patches add all the other interfaces one by one. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: tests: stresstest: bail out if device has not enough eraseblocksWolfram Sang1-0/+7
stresstest needs at least two eraseblocks. Bail out gracefully if that condition is not met. Fixes the following 'division by zero' OOPS: [ 619.100000] mtd_stresstest: MTD device size 131072, eraseblock size 131072, page size 2048, count of eraseblocks 1, pages per eraseblock 64, OOB size 64 [ 619.120000] mtd_stresstest: scanning for bad eraseblocks [ 619.120000] mtd_stresstest: scanned 1 eraseblocks, 0 are bad [ 619.130000] mtd_stresstest: doing operations [ 619.130000] mtd_stresstest: 0 operations done [ 619.140000] Division by zero in kernel. ... caused by /* Read or write up 2 eraseblocks at a time - hence 'ebcnt - 1' */ eb %= (ebcnt - 1); Cc: stable@kernel.org Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2011-10-30mtd: tests: don't use mtd0 as a defaultWolfram Sang7-7/+55
mtd tests may erase the mtd device, so force the user to specify which mtd device to test by using the module parameter. Disable the default (using mtd0) since this may destroy a vital part of the flash if the module is inserted accidently or carelessly. Reported-by: Roland Kletzing <devzero@web.de> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@intel.com>
2011-09-21mtd: utilize `mtd_is_*()' functionsBrian Norris6-25/+25
Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
2011-09-11mtd: rename MTD_OOB_* to MTD_OPS_*Brian Norris2-13/+13
These modes are not necessarily for OOB only. Particularly, MTD_OOB_RAW affected operations on in-band page data as well. To clarify these options and to emphasize that their effect is applied per-operation, we change the primary prefix to MTD_OPS_. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
2011-09-11mtd: tests: ignore corrected bitflips in OOB on mtd_readtestBrian Norris1-1/+2
read_oob may now return ECC error codes. If the code is -EUCLEAN, then we can safely ignore the error as a corrected bitflip. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2011-03-11mtd: speedtest: fix integer overflowDavid Lambert1-7/+7
32-bit integers used in 'calc_speed()' may overflow and lead to incorrect results. Use 64-bit integers instead. Signed-off-by: David Lambert <dave@lambsys.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2011-03-11mtd: tests: add multiblock erase test to the mtd_speedtestRoman Tereshonkov1-2/+57
New multiblock erase speed test is added to mtd_speedtest. It consists of 2-, 4-, 8-, 16-, 32- and 64-blocks at once multiblock erase tests. Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2011-03-11mtd: tests: add count parameter to mtd_speedtestAdrian Hunter1-2/+13
By default mtd_speedtest uses all the eraseblocks of the MTD partition being tested. For large partitions a smaller number is sufficient and makes running the test quicker. For that reason, add a parameter 'count' to specify the maximum number of eraseblocks to use for testing. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2011-03-11mtd: tests: print correct valuesRoman Tereshonkov1-5/+5
The ebcnt and pgcnt variable initialization is moved before printk which uses them. Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-08-02mtd: tests: return -1 if verify failedRoel Kluin1-5/+4
Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-05-13drivers/mtd: Use kzallocJulia Lawall5-10/+5
Use kzalloc rather than the combination of kmalloc and memset. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,size,flags; statement S; @@ -x = kmalloc(size,flags); +x = kzalloc(size,flags); if (x == NULL) S -memset(x, 0, size); // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.hTejun Heo8-1/+7
percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-01-13mtd: tests: fix read, speed and stress tests on NOR flashMorten Thunberg Svendsen3-3/+16
Before using block_isbad() check if mtd->block_isbad() is defined. Calculating pgcnt must be done using pgsize defined to 512 on NOR and mtd->writesize for NAND, not using mtd->writesize directly. Signed-off-by: Morten Thunberg Svendsen <mts.doredevelopment@gmail.com> Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2009-11-30mtd: make pagetest workArtem Bityutskiy1-0/+1
The mtd_pagetest test did not initialize the pgsize variable, which basically means it did not work. This problem was reported by Török Edwin <edwintorok@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>