]> git.karo-electronics.de Git - linux-beck.git/commitdiff
UBI: be verbose when debuggin is enabled
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 12 Feb 2008 11:26:31 +0000 (13:26 +0200)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Thu, 17 Apr 2008 08:31:58 +0000 (11:31 +0300)
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>
drivers/mtd/ubi/debug.h
drivers/mtd/ubi/io.c

index 51c40b17f1ec5c967994666ad0f7f3ce4b689f39..718740a63eb3ab0aec9cf1f76b5b68245c4aa3f1 100644 (file)
@@ -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
index db3efdef2433884eccc04ad03a9de9d63f4d9af2..4ac11df7b048d3a24684744c4f399f13b81653ea 100644 (file)
@@ -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,