diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-02-12 06:26:31 -0500 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-04-17 04:31:58 -0400 |
commit | a4f0fcdfb2397e81d22446bb364dc190bf16b25a (patch) | |
tree | 1261dcd0a2a4bf52065b0c9dedd4b730b6eed6cd /drivers/mtd/ubi | |
parent | f4988927a257791d372dddeda8eda8521bf6cb00 (diff) |
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@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi')
-rw-r--r-- | drivers/mtd/ubi/debug.h | 2 | ||||
-rw-r--r-- | 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 51c40b17f1ec..718740a63eb3 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); | |||
99 | #ifdef CONFIG_MTD_UBI_DEBUG_MSG_BLD | 99 | #ifdef CONFIG_MTD_UBI_DEBUG_MSG_BLD |
100 | /* Initialization and build messages */ | 100 | /* Initialization and build messages */ |
101 | #define dbg_bld(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) | 101 | #define dbg_bld(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) |
102 | #define UBI_IO_DEBUG 1 | ||
102 | #else | 103 | #else |
103 | #define dbg_bld(fmt, ...) ({}) | 104 | #define dbg_bld(fmt, ...) ({}) |
105 | #define UBI_IO_DEBUG 0 | ||
104 | #endif | 106 | #endif |
105 | 107 | ||
106 | #ifdef CONFIG_MTD_UBI_DEBUG_EMULATE_BITFLIPS | 108 | #ifdef CONFIG_MTD_UBI_DEBUG_EMULATE_BITFLIPS |
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c index db3efdef2433..4ac11df7b048 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, | |||
631 | 631 | ||
632 | dbg_io("read EC header from PEB %d", pnum); | 632 | dbg_io("read EC header from PEB %d", pnum); |
633 | ubi_assert(pnum >= 0 && pnum < ubi->peb_count); | 633 | ubi_assert(pnum >= 0 && pnum < ubi->peb_count); |
634 | if (UBI_IO_DEBUG) | ||
635 | verbose = 1; | ||
634 | 636 | ||
635 | err = ubi_io_read(ubi, ec_hdr, pnum, 0, UBI_EC_HDR_SIZE); | 637 | err = ubi_io_read(ubi, ec_hdr, pnum, 0, UBI_EC_HDR_SIZE); |
636 | if (err) { | 638 | if (err) { |
@@ -904,6 +906,8 @@ int ubi_io_read_vid_hdr(struct ubi_device *ubi, int pnum, | |||
904 | 906 | ||
905 | dbg_io("read VID header from PEB %d", pnum); | 907 | dbg_io("read VID header from PEB %d", pnum); |
906 | ubi_assert(pnum >= 0 && pnum < ubi->peb_count); | 908 | ubi_assert(pnum >= 0 && pnum < ubi->peb_count); |
909 | if (UBI_IO_DEBUG) | ||
910 | verbose = 1; | ||
907 | 911 | ||
908 | p = (char *)vid_hdr - ubi->vid_hdr_shift; | 912 | p = (char *)vid_hdr - ubi->vid_hdr_shift; |
909 | err = ubi_io_read(ubi, p, pnum, ubi->vid_hdr_aloffset, | 913 | err = ubi_io_read(ubi, p, pnum, ubi->vid_hdr_aloffset, |