aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-08-27 10:14:58 -0400
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-09-04 02:39:02 -0400
commit719bb84017fcfc949a77e150dd5b045e90a4ebc9 (patch)
tree4092867a0fdbe2d82f69ce1a60402a36042175cc
parente28453bbb76c290d67eb28b3ff6875a6519c3998 (diff)
UBI: print less
UBI currently prints a lot of information when it mounts a volume, which bothers some people. Make it less chatty - print only important information by default. Get rid of 'dbg_msg()' macro completely. Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
-rw-r--r--drivers/mtd/ubi/attach.c8
-rw-r--r--drivers/mtd/ubi/build.c73
-rw-r--r--drivers/mtd/ubi/cdev.c6
-rw-r--r--drivers/mtd/ubi/debug.h5
-rw-r--r--drivers/mtd/ubi/io.c2
-rw-r--r--drivers/mtd/ubi/vtbl.c2
-rw-r--r--drivers/mtd/ubi/wl.c2
7 files changed, 42 insertions, 56 deletions
diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
index e1d90683e357..da132155c796 100644
--- a/drivers/mtd/ubi/attach.c
+++ b/drivers/mtd/ubi/attach.c
@@ -794,8 +794,8 @@ static int check_corruption(struct ubi_device *ubi, struct ubi_vid_hdr *vid_hdr,
794 pnum); 794 pnum);
795 ubi_err("this may be a non-UBI PEB or a severe VID header corruption which requires manual inspection"); 795 ubi_err("this may be a non-UBI PEB or a severe VID header corruption which requires manual inspection");
796 ubi_dump_vid_hdr(vid_hdr); 796 ubi_dump_vid_hdr(vid_hdr);
797 dbg_msg("hexdump of PEB %d offset %d, length %d", 797 pr_err("hexdump of PEB %d offset %d, length %d",
798 pnum, ubi->leb_start, ubi->leb_size); 798 pnum, ubi->leb_start, ubi->leb_size);
799 ubi_dbg_print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1, 799 ubi_dbg_print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1,
800 ubi->peb_buf, ubi->leb_size, 1); 800 ubi->peb_buf, ubi->leb_size, 1);
801 err = 1; 801 err = 1;
@@ -1170,7 +1170,7 @@ static struct ubi_attach_info *scan_all(struct ubi_device *ubi)
1170 goto out_vidh; 1170 goto out_vidh;
1171 } 1171 }
1172 1172
1173 dbg_msg("scanning is finished"); 1173 ubi_msg("scanning is finished");
1174 1174
1175 /* Calculate mean erase counter */ 1175 /* Calculate mean erase counter */
1176 if (ai->ec_count) 1176 if (ai->ec_count)
@@ -1242,7 +1242,7 @@ int ubi_attach(struct ubi_device *ubi)
1242 ubi->corr_peb_count = ai->corr_peb_count; 1242 ubi->corr_peb_count = ai->corr_peb_count;
1243 ubi->max_ec = ai->max_ec; 1243 ubi->max_ec = ai->max_ec;
1244 ubi->mean_ec = ai->mean_ec; 1244 ubi->mean_ec = ai->mean_ec;
1245 ubi_msg("max. sequence number: %llu", ai->max_sqnum); 1245 dbg_gen("max. sequence number: %llu", ai->max_sqnum);
1246 1246
1247 err = ubi_read_volume_table(ubi, ai); 1247 err = ubi_read_volume_table(ubi, ai);
1248 if (err) 1248 if (err)
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 998a0bfc30dd..8fd85e32506a 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -619,6 +619,9 @@ static int get_bad_peb_limit(const struct ubi_device *ubi, int max_beb_per1024)
619 */ 619 */
620static int io_init(struct ubi_device *ubi, int max_beb_per1024) 620static int io_init(struct ubi_device *ubi, int max_beb_per1024)
621{ 621{
622 dbg_gen("sizeof(struct ubi_ainf_peb) %zu", sizeof(struct ubi_ainf_peb));
623 dbg_gen("sizeof(struct ubi_wl_entry) %zu", sizeof(struct ubi_wl_entry));
624
622 if (ubi->mtd->numeraseregions != 0) { 625 if (ubi->mtd->numeraseregions != 0) {
623 /* 626 /*
624 * Some flashes have several erase regions. Different regions 627 * Some flashes have several erase regions. Different regions
@@ -690,11 +693,11 @@ static int io_init(struct ubi_device *ubi, int max_beb_per1024)
690 ubi->ec_hdr_alsize = ALIGN(UBI_EC_HDR_SIZE, ubi->hdrs_min_io_size); 693 ubi->ec_hdr_alsize = ALIGN(UBI_EC_HDR_SIZE, ubi->hdrs_min_io_size);
691 ubi->vid_hdr_alsize = ALIGN(UBI_VID_HDR_SIZE, ubi->hdrs_min_io_size); 694 ubi->vid_hdr_alsize = ALIGN(UBI_VID_HDR_SIZE, ubi->hdrs_min_io_size);
692 695
693 dbg_msg("min_io_size %d", ubi->min_io_size); 696 dbg_gen("min_io_size %d", ubi->min_io_size);
694 dbg_msg("max_write_size %d", ubi->max_write_size); 697 dbg_gen("max_write_size %d", ubi->max_write_size);
695 dbg_msg("hdrs_min_io_size %d", ubi->hdrs_min_io_size); 698 dbg_gen("hdrs_min_io_size %d", ubi->hdrs_min_io_size);
696 dbg_msg("ec_hdr_alsize %d", ubi->ec_hdr_alsize); 699 dbg_gen("ec_hdr_alsize %d", ubi->ec_hdr_alsize);
697 dbg_msg("vid_hdr_alsize %d", ubi->vid_hdr_alsize); 700 dbg_gen("vid_hdr_alsize %d", ubi->vid_hdr_alsize);
698 701
699 if (ubi->vid_hdr_offset == 0) 702 if (ubi->vid_hdr_offset == 0)
700 /* Default offset */ 703 /* Default offset */
@@ -711,10 +714,10 @@ static int io_init(struct ubi_device *ubi, int max_beb_per1024)
711 ubi->leb_start = ubi->vid_hdr_offset + UBI_VID_HDR_SIZE; 714 ubi->leb_start = ubi->vid_hdr_offset + UBI_VID_HDR_SIZE;
712 ubi->leb_start = ALIGN(ubi->leb_start, ubi->min_io_size); 715 ubi->leb_start = ALIGN(ubi->leb_start, ubi->min_io_size);
713 716
714 dbg_msg("vid_hdr_offset %d", ubi->vid_hdr_offset); 717 dbg_gen("vid_hdr_offset %d", ubi->vid_hdr_offset);
715 dbg_msg("vid_hdr_aloffset %d", ubi->vid_hdr_aloffset); 718 dbg_gen("vid_hdr_aloffset %d", ubi->vid_hdr_aloffset);
716 dbg_msg("vid_hdr_shift %d", ubi->vid_hdr_shift); 719 dbg_gen("vid_hdr_shift %d", ubi->vid_hdr_shift);
717 dbg_msg("leb_start %d", ubi->leb_start); 720 dbg_gen("leb_start %d", ubi->leb_start);
718 721
719 /* The shift must be aligned to 32-bit boundary */ 722 /* The shift must be aligned to 32-bit boundary */
720 if (ubi->vid_hdr_shift % 4) { 723 if (ubi->vid_hdr_shift % 4) {
@@ -740,7 +743,7 @@ static int io_init(struct ubi_device *ubi, int max_beb_per1024)
740 ubi->max_erroneous = ubi->peb_count / 10; 743 ubi->max_erroneous = ubi->peb_count / 10;
741 if (ubi->max_erroneous < 16) 744 if (ubi->max_erroneous < 16)
742 ubi->max_erroneous = 16; 745 ubi->max_erroneous = 16;
743 dbg_msg("max_erroneous %d", ubi->max_erroneous); 746 dbg_gen("max_erroneous %d", ubi->max_erroneous);
744 747
745 /* 748 /*
746 * It may happen that EC and VID headers are situated in one minimal 749 * It may happen that EC and VID headers are situated in one minimal
@@ -760,17 +763,6 @@ static int io_init(struct ubi_device *ubi, int max_beb_per1024)
760 ubi->ro_mode = 1; 763 ubi->ro_mode = 1;
761 } 764 }
762 765
763 ubi_msg("physical eraseblock size: %d bytes (%d KiB)",
764 ubi->peb_size, ubi->peb_size >> 10);
765 ubi_msg("logical eraseblock size: %d bytes", ubi->leb_size);
766 ubi_msg("smallest flash I/O unit: %d", ubi->min_io_size);
767 if (ubi->hdrs_min_io_size != ubi->min_io_size)
768 ubi_msg("sub-page size: %d",
769 ubi->hdrs_min_io_size);
770 ubi_msg("VID header offset: %d (aligned %d)",
771 ubi->vid_hdr_offset, ubi->vid_hdr_aloffset);
772 ubi_msg("data offset: %d", ubi->leb_start);
773
774 /* 766 /*
775 * Note, ideally, we have to initialize @ubi->bad_peb_count here. But 767 * Note, ideally, we have to initialize @ubi->bad_peb_count here. But
776 * unfortunately, MTD does not provide this information. We should loop 768 * unfortunately, MTD does not provide this information. We should loop
@@ -932,8 +924,6 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
932 spin_lock_init(&ubi->volumes_lock); 924 spin_lock_init(&ubi->volumes_lock);
933 925
934 ubi_msg("attaching mtd%d to ubi%d", mtd->index, ubi_num); 926 ubi_msg("attaching mtd%d to ubi%d", mtd->index, ubi_num);
935 dbg_msg("sizeof(struct ubi_ainf_peb) %zu", sizeof(struct ubi_ainf_peb));
936 dbg_msg("sizeof(struct ubi_wl_entry) %zu", sizeof(struct ubi_wl_entry));
937 927
938 err = io_init(ubi, max_beb_per1024); 928 err = io_init(ubi, max_beb_per1024);
939 if (err) 929 if (err)
@@ -976,23 +966,24 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
976 goto out_debugfs; 966 goto out_debugfs;
977 } 967 }
978 968
979 ubi_msg("attached mtd%d to ubi%d", mtd->index, ubi_num); 969 ubi_msg("attached mtd%d (name \"%s\", size %llu MiB) to ubi%d",
980 ubi_msg("MTD device name: \"%s\"", mtd->name); 970 mtd->index, mtd->name, ubi->flash_size >> 20, ubi_num);
981 ubi_msg("MTD device size: %llu MiB", ubi->flash_size >> 20); 971 ubi_msg("PEB size: %d bytes (%d KiB), LEB size: %d bytes",
982 ubi_msg("number of good PEBs: %d", ubi->good_peb_count); 972 ubi->peb_size, ubi->peb_size >> 10, ubi->leb_size);
983 ubi_msg("number of bad PEBs: %d", ubi->bad_peb_count); 973 ubi_msg("min./max. I/O unit sizes: %d/%d, sub-page size %d",
984 ubi_msg("number of corrupted PEBs: %d", ubi->corr_peb_count); 974 ubi->min_io_size, ubi->max_write_size, ubi->hdrs_min_io_size);
985 ubi_msg("max. allowed volumes: %d", ubi->vtbl_slots); 975 ubi_msg("VID header offset: %d (aligned %d), data offset: %d",
986 ubi_msg("wear-leveling threshold: %d", CONFIG_MTD_UBI_WL_THRESHOLD); 976 ubi->vid_hdr_offset, ubi->vid_hdr_aloffset, ubi->leb_start);
987 ubi_msg("number of internal volumes: %d", UBI_INT_VOL_COUNT); 977 ubi_msg("good PEBs: %d, bad PEBs: %d, corrupted PEBs: %d",
988 ubi_msg("number of user volumes: %d", 978 ubi->good_peb_count, ubi->bad_peb_count, ubi->corr_peb_count);
989 ubi->vol_count - UBI_INT_VOL_COUNT); 979 ubi_msg("user volume: %d, internal volumes: %d, max. volumes count: %d",
990 ubi_msg("available PEBs: %d", ubi->avail_pebs); 980 ubi->vol_count - UBI_INT_VOL_COUNT, UBI_INT_VOL_COUNT,
991 ubi_msg("total number of reserved PEBs: %d", ubi->rsvd_pebs); 981 ubi->vtbl_slots);
992 ubi_msg("number of PEBs reserved for bad PEB handling: %d", 982 ubi_msg("max/mean erase counter: %d/%d, WL threshold: %d, image sequence number: %u",
993 ubi->beb_rsvd_pebs); 983 ubi->max_ec, ubi->mean_ec, CONFIG_MTD_UBI_WL_THRESHOLD,
994 ubi_msg("max/mean erase counter: %d/%d", ubi->max_ec, ubi->mean_ec); 984 ubi->image_seq);
995 ubi_msg("image sequence number: %u", ubi->image_seq); 985 ubi_msg("available PEBs: %d, total reserved PEBs: %d, PEBs reserved for bad PEB handling: %d",
986 ubi->avail_pebs, ubi->rsvd_pebs, ubi->beb_rsvd_pebs);
996 987
997 /* 988 /*
998 * The below lock makes sure we do not race with 'ubi_thread()' which 989 * The below lock makes sure we do not race with 'ubi_thread()' which
@@ -1069,7 +1060,7 @@ int ubi_detach_mtd_dev(int ubi_num, int anyway)
1069 1060
1070 ubi_assert(ubi_num == ubi->ubi_num); 1061 ubi_assert(ubi_num == ubi->ubi_num);
1071 ubi_notify_all(ubi, UBI_VOLUME_REMOVED, NULL); 1062 ubi_notify_all(ubi, UBI_VOLUME_REMOVED, NULL);
1072 dbg_msg("detaching mtd%d from ubi%d", ubi->mtd->index, ubi_num); 1063 ubi_msg("detaching mtd%d from ubi%d", ubi->mtd->index, ubi_num);
1073 1064
1074 /* 1065 /*
1075 * Before freeing anything, we have to stop the background thread to 1066 * Before freeing anything, we have to stop the background thread to
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c
index 540d2db492ee..dfcc65b33e99 100644
--- a/drivers/mtd/ubi/cdev.c
+++ b/drivers/mtd/ubi/cdev.c
@@ -754,7 +754,7 @@ static int rename_volumes(struct ubi_device *ubi,
754 re->new_name_len = name_len; 754 re->new_name_len = name_len;
755 memcpy(re->new_name, name, name_len); 755 memcpy(re->new_name, name, name_len);
756 list_add_tail(&re->list, &rename_list); 756 list_add_tail(&re->list, &rename_list);
757 dbg_msg("will rename volume %d from \"%s\" to \"%s\"", 757 dbg_gen("will rename volume %d from \"%s\" to \"%s\"",
758 vol_id, re->desc->vol->name, name); 758 vol_id, re->desc->vol->name, name);
759 } 759 }
760 760
@@ -812,7 +812,7 @@ static int rename_volumes(struct ubi_device *ubi,
812 re1->remove = 1; 812 re1->remove = 1;
813 re1->desc = desc; 813 re1->desc = desc;
814 list_add(&re1->list, &rename_list); 814 list_add(&re1->list, &rename_list);
815 dbg_msg("will remove volume %d, name \"%s\"", 815 dbg_gen("will remove volume %d, name \"%s\"",
816 re1->desc->vol->vol_id, re1->desc->vol->name); 816 re1->desc->vol->vol_id, re1->desc->vol->name);
817 } 817 }
818 818
@@ -943,7 +943,7 @@ static long ubi_cdev_ioctl(struct file *file, unsigned int cmd,
943 { 943 {
944 struct ubi_rnvol_req *req; 944 struct ubi_rnvol_req *req;
945 945
946 dbg_msg("re-name volumes"); 946 dbg_gen("re-name volumes");
947 req = kmalloc(sizeof(struct ubi_rnvol_req), GFP_KERNEL); 947 req = kmalloc(sizeof(struct ubi_rnvol_req), GFP_KERNEL);
948 if (!req) { 948 if (!req) {
949 err = -ENOMEM; 949 err = -ENOMEM;
diff --git a/drivers/mtd/ubi/debug.h b/drivers/mtd/ubi/debug.h
index ea4cb7ca3352..3dbc877d9663 100644
--- a/drivers/mtd/ubi/debug.h
+++ b/drivers/mtd/ubi/debug.h
@@ -42,11 +42,6 @@ void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr);
42 pr_debug("UBI DBG " type " (pid %d): " fmt "\n", current->pid, \ 42 pr_debug("UBI DBG " type " (pid %d): " fmt "\n", current->pid, \
43 ##__VA_ARGS__) 43 ##__VA_ARGS__)
44 44
45/* Just a debugging messages not related to any specific UBI subsystem */
46#define dbg_msg(fmt, ...) \
47 pr_err("UBI DBG (pid %d): %s: " fmt "\n", \
48 current->pid, __func__, ##__VA_ARGS__)
49
50/* General debugging messages */ 45/* General debugging messages */
51#define dbg_gen(fmt, ...) ubi_dbg_msg("gen", fmt, ##__VA_ARGS__) 46#define dbg_gen(fmt, ...) ubi_dbg_msg("gen", fmt, ##__VA_ARGS__)
52/* Messages from the eraseblock association sub-system */ 47/* Messages from the eraseblock association sub-system */
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c
index 321541159f51..78a1dcbf2107 100644
--- a/drivers/mtd/ubi/io.c
+++ b/drivers/mtd/ubi/io.c
@@ -177,7 +177,7 @@ retry:
177 * enabled. A corresponding message will be printed 177 * enabled. A corresponding message will be printed
178 * later, when it is has been scrubbed. 178 * later, when it is has been scrubbed.
179 */ 179 */
180 dbg_msg("fixable bit-flip detected at PEB %d", pnum); 180 ubi_msg("fixable bit-flip detected at PEB %d", pnum);
181 ubi_assert(len == read); 181 ubi_assert(len == read);
182 return UBI_IO_BITFLIPS; 182 return UBI_IO_BITFLIPS;
183 } 183 }
diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c
index 7e7c20114edb..64b9c56adfaf 100644
--- a/drivers/mtd/ubi/vtbl.c
+++ b/drivers/mtd/ubi/vtbl.c
@@ -304,7 +304,7 @@ static int create_vtbl(struct ubi_device *ubi, struct ubi_attach_info *ai,
304 struct ubi_vid_hdr *vid_hdr; 304 struct ubi_vid_hdr *vid_hdr;
305 struct ubi_ainf_peb *new_aeb; 305 struct ubi_ainf_peb *new_aeb;
306 306
307 ubi_msg("create volume table (copy #%d)", copy + 1); 307 dbg_gen("create volume table (copy #%d)", copy + 1);
308 308
309 vid_hdr = ubi_zalloc_vid_hdr(ubi, GFP_KERNEL); 309 vid_hdr = ubi_zalloc_vid_hdr(ubi, GFP_KERNEL);
310 if (!vid_hdr) 310 if (!vid_hdr)
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c
index bd05276252fb..032fc57f1090 100644
--- a/drivers/mtd/ubi/wl.c
+++ b/drivers/mtd/ubi/wl.c
@@ -1201,7 +1201,7 @@ int ubi_wl_scrub_peb(struct ubi_device *ubi, int pnum)
1201{ 1201{
1202 struct ubi_wl_entry *e; 1202 struct ubi_wl_entry *e;
1203 1203
1204 dbg_msg("schedule PEB %d for scrubbing", pnum); 1204 ubi_msg("schedule PEB %d for scrubbing", pnum);
1205 1205
1206retry: 1206retry:
1207 spin_lock(&ubi->wl_lock); 1207 spin_lock(&ubi->wl_lock);