aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/debug.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-04-13UBI: power cut emulation for testingdavid.oberhollenzer@sigma-star.at1-0/+2
Emulate random power cuts by switching device to ro after a number of writes to allow simple power cut testing with nand-sim. Maximum and minimum number of successful writes before power cut and what kind of writes (EC header, VID header or none) to interrupt configurable via debugfs. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at> Signed-off-by: Richard Weinberger <richard@nod.at>
2015-03-26UBI: Fastmap: Add new module parameter fm_debugRichard Weinberger1-0/+5
If fm_debug is set fastmap debugging is enabled by default. This is useful if one wants to debug fastmap on an UBI device with serves the rootfs. The the UBI attach mechanism runs long before debugfs can be mounted and chk_fastmap set. Signed-off-by: Richard Weinberger <richard@nod.at>
2015-03-26UBI: Add initial support for fastmap self checksRichard Weinberger1-0/+5
Using this debugfs knob fastmap self checks can be controlled. Signed-off-by: Richard Weinberger <richard@nod.at> Reviewed-by: Tanya Brokhman <tlinder@codeaurora.org>
2013-02-04mtd: rename random32() to prandom_u32()Akinobu Mita1-3/+3
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-10UBI: embed ubi_debug_info field in ubi_device structEzequiel Garcia1-46/+6
ubi_debug_info struct was dynamically allocated which is always suboptimal, for it tends to fragment memory and make the code error-prone. Fix this by embedding it in ubi_device struct. Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-12-10UBI: introduce helpers dbg_chk_{io, gen}Ezequiel Garcia1-0/+9
With this patch code is a bit more readable and there's no generated code or functionality impact. Furthermore, this abstracts implementation details and will allow to change ubi_debug_info in a less invasive way. Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-09-04UBI: print lessArtem Bityutskiy1-5/+0
UBI currently prints a lot of information when it mounts a volume, which bothers some people. Make it less chatty - print only important information by default. Get rid of 'dbg_msg()' macro completely. Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-09-04UBI: use pr_ helper instead of printkArtem Bityutskiy1-4/+4
Use 'pr_err()' instead of 'printk(KERN_ERR', etc. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-09-04UBI: print PID in debug messagesArtem Bityutskiy1-1/+2
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: rename sv to avArtem Bityutskiy1-1/+1
After re-naming the 'struct ubi_scan_volume' we should adjust all variables named 'sv' to something else, because 'sv' stands for "scanning volume". Let's rename it to 'av' which stands for "attaching volume" which is a bit more consistent and has the same length, which makes re-naming easy. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
2012-05-20UBI: rename seb to aebArtem Bityutskiy1-1/+1
After re-naming the 'struct ubi_scan_leb' we should adjust all variables named 'seb' to something else, because 'seb' stands for "scanning eraseblock". Let's rename it to 'aeb' which stands for "attaching eraseblock" which is a bit more consistend and has the same length. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
2012-05-20UBI: rename struct ubi_scan_volumeArtem Bityutskiy1-1/+1
Rename 'struct ubi_scan_volume' to 'struct ubi_ainf_volume'. This is part of the code re-structuring I am trying to do in order to add fastmap in a more logical way. Fastmap can share a lot with scanning, including the attach-time data structures, which all now have "scan" word in the name. Let's get rid of this word and use "ainf" instead which stands for "attach information". It has the same length as "scan" so re-naming is trivial. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
2012-05-20UBI: rename struct ubi_scan_lebArtem Bityutskiy1-1/+1
Rename 'struct ubi_scan_leb' to 'struct ubi_ainf_leb'. This is part of the code re-structuring I am trying to do in order to add fastmap in a more logical way. Fastmap can share a lot with scanning, including the attach-time data structures, which all now have "scan" word in the name. Let's get rid of this word and use "ainf" instead which stands for "attach information". It has the same length as "scan" so re-naming is trivial. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
2012-05-20UBI: rename few functions for consistencyArtem Bityutskiy1-3/+2
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: get rid of dbg_errArtem Bityutskiy1-2/+0
This patch removes the 'dbg_err()' macro and we now use 'ubi_err' instead. The idea of 'dbg_err()' was to compile out some error message to make the binary a bit smaller - but I think it was a bad idea. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: remove Kconfig debugging optionArtem Bityutskiy1-63/+0
This patch kills the UBI debugging Kconfig option completely and makes all the debugging stuff to be always compiled-in. It was pain in the neck to maintain this useless option because all users I am aware of have debugging enabled anyway - how else will you diagnose errors otherwise? Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: rename ubi_dbg_dump_mkvol_reqArtem Bityutskiy1-2/+2
I am going to remove the "UBI debugging" compilation option and make the debugging stuff to be always compiled it. This patch is a preparation which renames 'ubi_dbg_dump_mkvol_req()' to 'ubi_dump_mkvol_req()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: rename ubi_dbg_dump_sebArtem Bityutskiy1-3/+3
I am going to remove the "UBI debugging" compilation option and make the debugging stuff to be always compiled it. This patch is a preparation which renames 'ubi_dbg_dump_seb()' to 'ubi_dump_seb()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: rename ubi_dbg_dump_svArtem Bityutskiy1-2/+2
I am going to remove the "UBI debugging" compilation option and make the debugging stuff to be always compiled it. This patch is a preparation which renames 'ubi_dbg_dump_sv()' to 'ubi_dump_sv()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: rename ubi_dbg_dump_vtbl_recordArtem Bityutskiy1-2/+2
I am going to remove the "UBI debugging" compilation option and make the debugging stuff to be always compiled it. This patch is a preparation which renames 'ubi_dbg_dump_vtbl_record()' to 'ubi_dump_vtbl_record()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: rename ubi_dbg_dump_vol_infoArtem Bityutskiy1-2/+2
I am going to remove the "UBI debugging" compilation option and make the debugging stuff to be always compiled it. This patch is a preparation which renames 'ubi_dbg_dump_vol_info()' to 'ubi_dump_vol_info()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: always dump VID and EC headers in case of errorsArtem Bityutskiy1-6/+2
UBI (and UBIFS) are a bit over-engineered WRT debugging. The idea was to link as few as possible when debugging is disabled, but the downside is that most people produce bug reports which are difficult to understand. Always dump the VID and EC headers' contents in case of errors when it is helpful. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-05-20UBI: always dump flash contents in case of errorsArtem Bityutskiy1-3/+2
UBI (and UBIFS) are a bit over-engineered WRT debugging. The idea was to link as few as possible when debugging is disabled, but the downside is that most people produce bug reports which are difficult to understand. Always dump the flash contents in case of errors, not only when debugging is enabled. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
2012-05-20UBI: always dump the stack on errorArtem Bityutskiy1-4/+1
UBI (and UBIFS) are a bit over-engineered WRT debugging. The idea was to link as few as possible when debugging is disabled, but the downside is that most people produce bug reports which are difficult to understand. This patch weeds out the 'ubi_dbg_dump_stack()' function and turns it into 'dump_stack()' - it is always useful to have stack dump in case of an error. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
2012-01-11UBI: fix debugging messagesArtem Bityutskiy1-1/+4
Patch ab50ff684707031ed4bad2fdd313208ae392e5bb broke UBI debugging messages: before that commit when UBI debugging was enabled, users saw few useful debugging messages after attaching an MTD device. However, that patch turned 'dbg_msg()' into 'pr_debug()', so to enable the debugging messages users have to enable them first via /sys/kernel/debug/dynamic_debug/control, which is very impractical. This commit makes 'dbg_msg()' to use 'printk()' instead of 'pr_debug()', just as it was before the breakage. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Cc: stable@kernel.org [3.0+]
2011-08-19UBI: do not link debug messages when debugging is disabledArtem Bityutskiy1-1/+1
Michal Marek spotted the same issue in UBIFS and this patch fixes UBI, see "UBIFS: not build debug messages with CONFIG_UBIFS_FS_DEBUG disabled" When UBI debugging is disabled, we have debugging messages defined as: if (0) pr_debug() But pr_debug macro defines data structures with debugging data and makes the linux binary larger, even though we have "if (0)". Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
2011-06-01UBI: switch debugging tests knobs to debugfsArtem Bityutskiy1-21/+16
Kill the UBI 'debug_tsts' module parameter and switch to debugfs. Create per-test mode files there. E.g., to enable bit-flips emulation you may just do: echo 1 > /sys/kernel/debug/ubi/ubi0/tst_emulate_bitflips Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-01UBI: make it possible to use struct ubi_device in debug.hArtem Bityutskiy1-8/+0
Current layout does not allow us to add inline functions to debug.h which use the 'struct ubi_device' object, because it is undefined there. Move '#include "debug.h"' in "ubi.h" down so to make 'struct ubi_device" be defined. Additionally, this makes it possible to remove a bunch of forward declarations in "debug.h". This is a preparation to the next patch. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-01UBI: prepare debugging stuff to further debugfs conversionArtem Bityutskiy1-8/+15
We'll need the 'struct ubi_device *ubi' pointer in every debugging function (to access the ->dbg field), so add this pointer to all the functions implementing UBI debugging test modes like 'ubi_dbg_is_bitflip()' etc. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-06-01UBI: use debugfs for the extra checks knobsArtem Bityutskiy1-17/+42
This patch introduces debugfs support to UBI. All the UBI stuff is kept in the "ubi" debugfs directory, which contains per-UBI device "ubi/ubiX" sub-directories, containing debugging files. This file also creates "ubi/ubiX/chk_gen" and "ubi/ubiX/chk_io" knobs for switching general and I/O extra checks on and off. And it removes the 'debug_chks' UBI module parameters. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-05-20UBI: switch to dynamic printksArtem Bityutskiy1-55/+28
Remove custom dynamic prints and the module parameter to toggle them and use the generic kernel dynamic printk infrastructure. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-05-20UBI: turn some macros into static inlineArtem Bityutskiy1-25/+38
Similarly as we have done for UBIFS in 1dcffad74183bb00e8129ba1c5bb2c9931d31bd7, turn the debugging macros into static inline functions, for the same reasons: to avoid gcc 4.5 warnings. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-05-20UBI: improve checking in debugging printsArtem Bityutskiy1-8/+25
When debugging is disabled, define debugging prints as if (0) printk() to make sure that the compiler still the format string in debugging messages even if debugging is disabled. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-03-16UBI: make tests modes dynamicArtem Bityutskiy1-20/+36
Similarly to the debugging checks and message, make the test modes be dynamically selected via the "debug_tsts" module parameter or via the "/sys/module/ubi/parameters/debug_tsts" sysfs file. This is consistent with UBIFS as well. And now, since all the Kconfig knobs became dynamic, we can remove the Kconfig.debug file completely. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-03-16UBI: make self-checks dynamicArtem Bityutskiy1-5/+13
This patch adds a possibility to dynamically switch UBI self-checks on and off, instead of toggling them compile-time from the configuration menu. This is much more flexible, and consistent with UBIFS, and this also simplifies UBI Kconfig menu and the code. This patch introduces two levels of self-checks - general, which includes all self-checks which are relatively fast, and I/O, which includes write-verify checks and erase-verify checks, which are relatively slow and involve flash I/O. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-03-16UBI: make debugging messages dynamicArtem Bityutskiy1-25/+29
This patch adds a possibility to dynamically select UBI debugging messages, instead of selecting them compile-time from the configuration menu. This is much more flexible, and consistent with UBIFS, and this also simplifies UBI Kconfig menu and the code. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-03-16UBI: remove UBI_IO_DEBUG macroArtem Bityutskiy1-3/+0
This additional little macro is used to print a bit more messages while scanning the media. However, we have the 'dbg_bld()' macro for this, so we better us 'dbg_bld()' and kill UBI_IO_DEBUG. This simplifies the code a tiny bit. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-10-19UBI: introduce debugging helper functionArtem Bityutskiy1-0/+4
Introduce a helper function to print hexdump: 'ubi_dbg_print_hex_dump()'. It is compiled out if debugging is enabled. Will be used in the next patch. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-02-01UBI: add write checkingArtem Bityutskiy1-0/+4
Add an extra debugging check function which validates writes. After every write it reads the data back, compares it with the original data, and complains if they mismatch. Useful for debugging. No-op if extra debugging checks are disabled. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-08-14UBI: introduce flash dump helperArtem Bityutskiy1-0/+2
Useful for debugging problems, compiled in only if UBI debugging is enabled. This patch also makes the UBI writing function dump the flash if it fails to write. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-07-05UBI: remove bogus debugging checksArtem Bityutskiy1-0/+1
The 'paranoid_check_empty()' is bogus because, which is easilly seen on NOR flash, which has long erase cycles, and which may easilly end-up with half-erased eraseblocks. In this case the paranoid check fails. I is just wrong to assume that PEBs which do not have EC headers always contain all 0xFF. Such assumption should not be made on the I/O level, which is quite low. Thus, just kill the check. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-07-05UBI: add empty eraseblocks verificationArtem Bityutskiy1-0/+6
This patch adds code which makes sure eraseblocks contain all 0xFF bytes before starting using them. The verification is done only when debugging checks are enabled. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-12-28UBI: fix checkpatch.pl warningsArtem Bityutskiy1-5/+5
Just minor indentation and "over 80 characters" fixes. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-07-24UBI: fix and re-work debugging stuffArtem Bityutskiy1-24/+44
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-07-24UBI: amend commentariesArtem Bityutskiy1-3/+3
Hch asked not to use "unit" for sub-systems, let it be so. Also some other commentaries modifications. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-04-23Merge git://git.infradead.org/~dedekind/ubi-2.6David Woodhouse1-0/+2
2008-04-22[MTD] replace remaining __FUNCTION__ occurrencesHarvey Harrison1-1/+1
__FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2008-04-17UBI: be verbose when debuggin is enabledArtem Bityutskiy1-0/+2
Make I/O function to be always verbose when about CRC errors and magic number errors when I/O debugging is enabled. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2007-12-26UBI: add PID to debugging printsArtem Bityutskiy1-14/+7
Also, use single dbg_msg() macro for all prints. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2007-10-14UBI: use linux print_hex_dump(), not home-grown oneArtem Bityutskiy1-2/+0
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>