Skip to content

Commit a4f0fcd

Browse files
Artem BityutskiyArtem Bityutskiy
authored andcommitted
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>
1 parent f498892 commit a4f0fcd

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

‎drivers/mtd/ubi/debug.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,10 @@ void ubi_dbg_dump_mkvol_req(const struct ubi_mkvol_req *req);
9999
#ifdef CONFIG_MTD_UBI_DEBUG_MSG_BLD
100100
/* Initialization and build messages */
101101
#define dbg_bld(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
102+
#define UBI_IO_DEBUG 1
102103
#else
103104
#define dbg_bld(fmt, ...) ({})
105+
#define UBI_IO_DEBUG 0
104106
#endif
105107

106108
#ifdef CONFIG_MTD_UBI_DEBUG_EMULATE_BITFLIPS

‎drivers/mtd/ubi/io.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,8 @@ int ubi_io_read_ec_hdr(struct ubi_device *ubi, int pnum,
631631

632632
dbg_io("read EC header from PEB %d", pnum);
633633
ubi_assert(pnum >= 0 && pnum < ubi->peb_count);
634+
if (UBI_IO_DEBUG)
635+
verbose = 1;
634636

635637
err = ubi_io_read(ubi, ec_hdr, pnum, 0, UBI_EC_HDR_SIZE);
636638
if (err) {
@@ -904,6 +906,8 @@ int ubi_io_read_vid_hdr(struct ubi_device *ubi, int pnum,
904906

905907
dbg_io("read VID header from PEB %d", pnum);
906908
ubi_assert(pnum >= 0 && pnum < ubi->peb_count);
909+
if (UBI_IO_DEBUG)
910+
verbose = 1;
907911

908912
p = (char *)vid_hdr - ubi->vid_hdr_shift;
909913
err = ubi_io_read(ubi, p, pnum, ubi->vid_hdr_aloffset,

0 commit comments

Comments
 (0)