aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/scan.c
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/scan.c
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/scan.c')
-rw-r--r--drivers/mtd/ubi/scan.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c
index b65cc088fde5..11eb8ef12485 100644
--- a/drivers/mtd/ubi/scan.c
+++ b/drivers/mtd/ubi/scan.c
@@ -88,7 +88,7 @@
88#include <linux/random.h> 88#include <linux/random.h>
89#include "ubi.h" 89#include "ubi.h"
90 90
91#ifdef CONFIG_MTD_UBI_DEBUG_PARANOID 91#ifdef CONFIG_MTD_UBI_DEBUG
92static int paranoid_check_si(struct ubi_device *ubi, struct ubi_scan_info *si); 92static int paranoid_check_si(struct ubi_device *ubi, struct ubi_scan_info *si);
93#else 93#else
94#define paranoid_check_si(ubi, si) 0 94#define paranoid_check_si(ubi, si) 0
@@ -1329,7 +1329,7 @@ void ubi_scan_destroy_si(struct ubi_scan_info *si)
1329 kfree(si); 1329 kfree(si);
1330} 1330}
1331 1331
1332#ifdef CONFIG_MTD_UBI_DEBUG_PARANOID 1332#ifdef CONFIG_MTD_UBI_DEBUG
1333 1333
1334/** 1334/**
1335 * paranoid_check_si - check the scanning information. 1335 * paranoid_check_si - check the scanning information.
@@ -1347,6 +1347,9 @@ static int paranoid_check_si(struct ubi_device *ubi, struct ubi_scan_info *si)
1347 struct ubi_scan_leb *seb, *last_seb; 1347 struct ubi_scan_leb *seb, *last_seb;
1348 uint8_t *buf; 1348 uint8_t *buf;
1349 1349
1350 if (!(ubi_chk_flags & UBI_CHK_GEN))
1351 return 0;
1352
1350 /* 1353 /*
1351 * At first, check that scanning information is OK. 1354 * At first, check that scanning information is OK.
1352 */ 1355 */
@@ -1599,4 +1602,4 @@ out:
1599 return -EINVAL; 1602 return -EINVAL;
1600} 1603}
1601 1604
1602#endif /* CONFIG_MTD_UBI_DEBUG_PARANOID */ 1605#endif /* CONFIG_MTD_UBI_DEBUG */