aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/debug.h
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-03-14 12:17:40 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-03-16 07:50:16 -0400
commit92d124f5314913a21f7fa98b22ee457dab171edd (patch)
tree8a8c187f12290424419f0a05caeb202cd73253cc /drivers/mtd/ubi/debug.h
parentb342efd4a49cef9cf1a260c1814aad97722f38f8 (diff)
UBI: make self-checks dynamic
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>
Diffstat (limited to 'drivers/mtd/ubi/debug.h')
-rw-r--r--drivers/mtd/ubi/debug.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/mtd/ubi/debug.h b/drivers/mtd/ubi/debug.h
index bee6fa1e5147..2511b586490a 100644
--- a/drivers/mtd/ubi/debug.h
+++ b/drivers/mtd/ubi/debug.h
@@ -99,14 +99,22 @@ enum {
99/* Initialization and build messages */ 99/* Initialization and build messages */
100#define dbg_bld(fmt, ...) dbg_do_msg(UBI_MSG_BLD, fmt, ##__VA_ARGS__) 100#define dbg_bld(fmt, ...) dbg_do_msg(UBI_MSG_BLD, fmt, ##__VA_ARGS__)
101 101
102#ifdef CONFIG_MTD_UBI_DEBUG_PARANOID 102extern unsigned int ubi_chk_flags;
103
104/*
105 * Debugging check flags.
106 *
107 * UBI_CHK_GEN: general checks
108 * UBI_CHK_IO: check writes and erases
109 */
110enum {
111 UBI_CHK_GEN = 0x1,
112 UBI_CHK_IO = 0x2,
113};
114
103int ubi_dbg_check_all_ff(struct ubi_device *ubi, int pnum, int offset, int len); 115int ubi_dbg_check_all_ff(struct ubi_device *ubi, int pnum, int offset, int len);
104int ubi_dbg_check_write(struct ubi_device *ubi, const void *buf, int pnum, 116int ubi_dbg_check_write(struct ubi_device *ubi, const void *buf, int pnum,
105 int offset, int len); 117 int offset, int len);
106#else
107#define ubi_dbg_check_all_ff(ubi, pnum, offset, len) 0
108#define ubi_dbg_check_write(ubi, buf, pnum, offset, len) 0
109#endif
110 118
111#ifdef CONFIG_MTD_UBI_DEBUG_DISABLE_BGT 119#ifdef CONFIG_MTD_UBI_DEBUG_DISABLE_BGT
112#define DBG_DISABLE_BGT 1 120#define DBG_DISABLE_BGT 1