summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/debug.h
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-03-14 18:17:40 +0200
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-03-16 13:50:16 +0200
commit92d124f5314913a21f7fa98b22ee457dab171edd (patch)
tree8a8c187f12290424419f0a05caeb202cd73253cc /drivers/mtd/ubi/debug.h
parentb342efd4a49cef9cf1a260c1814aad97722f38f8 (diff)
downloadop-kernel-dev-92d124f5314913a21f7fa98b22ee457dab171edd.zip
op-kernel-dev-92d124f5314913a21f7fa98b22ee457dab171edd.tar.gz
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 bee6fa1..2511b58 100644
--- a/drivers/mtd/ubi/debug.h
+++ b/drivers/mtd/ubi/debug.h
@@ -99,14 +99,22 @@ enum {
/* Initialization and build messages */
#define dbg_bld(fmt, ...) dbg_do_msg(UBI_MSG_BLD, fmt, ##__VA_ARGS__)
-#ifdef CONFIG_MTD_UBI_DEBUG_PARANOID
+extern unsigned int ubi_chk_flags;
+
+/*
+ * Debugging check flags.
+ *
+ * UBI_CHK_GEN: general checks
+ * UBI_CHK_IO: check writes and erases
+ */
+enum {
+ UBI_CHK_GEN = 0x1,
+ UBI_CHK_IO = 0x2,
+};
+
int ubi_dbg_check_all_ff(struct ubi_device *ubi, int pnum, int offset, int len);
int ubi_dbg_check_write(struct ubi_device *ubi, const void *buf, int pnum,
int offset, int len);
-#else
-#define ubi_dbg_check_all_ff(ubi, pnum, offset, len) 0
-#define ubi_dbg_check_write(ubi, buf, pnum, offset, len) 0
-#endif
#ifdef CONFIG_MTD_UBI_DEBUG_DISABLE_BGT
#define DBG_DISABLE_BGT 1
OpenPOWER on IntegriCloud