UBI: be verbose when debuggin is enabled
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Wed Apr 23 05:59:01 EDT 2008
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=a4f0fcdfb2397e81d22446bb364dc190bf16b25a
Commit: a4f0fcdfb2397e81d22446bb364dc190bf16b25a
Parent: f4988927a257791d372dddeda8eda8521bf6cb00
Author: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
AuthorDate: Tue Feb 12 13:26:31 2008 +0200
Committer: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
CommitDate: Thu Apr 17 11:31:58 2008 +0300
UBI: be verbose when debuggin is enabled
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 at nokia.com>
---
drivers/mtd/ubi/debug.h | 2 ++
drivers/mtd/ubi/io.c | 4 ++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/mtd/ubi/debug.h b/drivers/mtd/ubi/debug.h
index 51c40b1..718740a 100644
--- a/drivers/mtd/ubi/debug.h
+++ b/drivers/mtd/ubi/debug.h
@@ -99,8 +99,10 @@ void ubi_dbg_dump_mkvol_req(const struct ubi_mkvol_req *req);
#ifdef CONFIG_MTD_UBI_DEBUG_MSG_BLD
/* Initialization and build messages */
#define dbg_bld(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
+#define UBI_IO_DEBUG 1
#else
#define dbg_bld(fmt, ...) ({})
+#define UBI_IO_DEBUG 0
#endif
#ifdef CONFIG_MTD_UBI_DEBUG_EMULATE_BITFLIPS
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c
index db3efde..4ac11df 100644
--- a/drivers/mtd/ubi/io.c
+++ b/drivers/mtd/ubi/io.c
@@ -631,6 +631,8 @@ int ubi_io_read_ec_hdr(struct ubi_device *ubi, int pnum,
dbg_io("read EC header from PEB %d", pnum);
ubi_assert(pnum >= 0 && pnum < ubi->peb_count);
+ if (UBI_IO_DEBUG)
+ verbose = 1;
err = ubi_io_read(ubi, ec_hdr, pnum, 0, UBI_EC_HDR_SIZE);
if (err) {
@@ -904,6 +906,8 @@ int ubi_io_read_vid_hdr(struct ubi_device *ubi, int pnum,
dbg_io("read VID header from PEB %d", pnum);
ubi_assert(pnum >= 0 && pnum < ubi->peb_count);
+ if (UBI_IO_DEBUG)
+ verbose = 1;
p = (char *)vid_hdr - ubi->vid_hdr_shift;
err = ubi_io_read(ubi, p, pnum, ubi->vid_hdr_aloffset,
More information about the linux-mtd-cvs
mailing list