Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+42 -56
+4 -4
drivers/mtd/ubi/attach.c
··· 794 794 pnum); 795 795 ubi_err("this may be a non-UBI PEB or a severe VID header corruption which requires manual inspection"); 796 796 ubi_dump_vid_hdr(vid_hdr); 797 - dbg_msg("hexdump of PEB %d offset %d, length %d", 798 - pnum, ubi->leb_start, ubi->leb_size); 797 + pr_err("hexdump of PEB %d offset %d, length %d", 798 + pnum, ubi->leb_start, ubi->leb_size); 799 799 ubi_dbg_print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1, 800 800 ubi->peb_buf, ubi->leb_size, 1); 801 801 err = 1; ··· 1170 1170 goto out_vidh; 1171 1171 } 1172 1172 1173 - dbg_msg("scanning is finished"); 1173 + ubi_msg("scanning is finished"); 1174 1174 1175 1175 /* Calculate mean erase counter */ 1176 1176 if (ai->ec_count) ··· 1242 1242 ubi->corr_peb_count = ai->corr_peb_count; 1243 1243 ubi->max_ec = ai->max_ec; 1244 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 1247 err = ubi_read_volume_table(ubi, ai); 1248 1248 if (err)
+32 -41
drivers/mtd/ubi/build.c
··· 619 619 */ 620 620 static 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 625 if (ubi->mtd->numeraseregions != 0) { 623 626 /* 624 627 * Some flashes have several erase regions. Different regions ··· 693 690 ubi->ec_hdr_alsize = ALIGN(UBI_EC_HDR_SIZE, ubi->hdrs_min_io_size); 694 691 ubi->vid_hdr_alsize = ALIGN(UBI_VID_HDR_SIZE, ubi->hdrs_min_io_size); 695 692 696 - dbg_msg("min_io_size %d", ubi->min_io_size); 697 - dbg_msg("max_write_size %d", ubi->max_write_size); 698 - dbg_msg("hdrs_min_io_size %d", ubi->hdrs_min_io_size); 699 - dbg_msg("ec_hdr_alsize %d", ubi->ec_hdr_alsize); 700 - dbg_msg("vid_hdr_alsize %d", ubi->vid_hdr_alsize); 693 + dbg_gen("min_io_size %d", ubi->min_io_size); 694 + dbg_gen("max_write_size %d", ubi->max_write_size); 695 + dbg_gen("hdrs_min_io_size %d", ubi->hdrs_min_io_size); 696 + dbg_gen("ec_hdr_alsize %d", ubi->ec_hdr_alsize); 697 + dbg_gen("vid_hdr_alsize %d", ubi->vid_hdr_alsize); 701 698 702 699 if (ubi->vid_hdr_offset == 0) 703 700 /* Default offset */ ··· 714 711 ubi->leb_start = ubi->vid_hdr_offset + UBI_VID_HDR_SIZE; 715 712 ubi->leb_start = ALIGN(ubi->leb_start, ubi->min_io_size); 716 713 717 - dbg_msg("vid_hdr_offset %d", ubi->vid_hdr_offset); 718 - dbg_msg("vid_hdr_aloffset %d", ubi->vid_hdr_aloffset); 719 - dbg_msg("vid_hdr_shift %d", ubi->vid_hdr_shift); 720 - dbg_msg("leb_start %d", ubi->leb_start); 714 + dbg_gen("vid_hdr_offset %d", ubi->vid_hdr_offset); 715 + dbg_gen("vid_hdr_aloffset %d", ubi->vid_hdr_aloffset); 716 + dbg_gen("vid_hdr_shift %d", ubi->vid_hdr_shift); 717 + dbg_gen("leb_start %d", ubi->leb_start); 721 718 722 719 /* The shift must be aligned to 32-bit boundary */ 723 720 if (ubi->vid_hdr_shift % 4) { ··· 743 740 ubi->max_erroneous = ubi->peb_count / 10; 744 741 if (ubi->max_erroneous < 16) 745 742 ubi->max_erroneous = 16; 746 - dbg_msg("max_erroneous %d", ubi->max_erroneous); 743 + dbg_gen("max_erroneous %d", ubi->max_erroneous); 747 744 748 745 /* 749 746 * It may happen that EC and VID headers are situated in one minimal ··· 762 759 ubi->mtd->index); 763 760 ubi->ro_mode = 1; 764 761 } 765 - 766 - ubi_msg("physical eraseblock size: %d bytes (%d KiB)", 767 - ubi->peb_size, ubi->peb_size >> 10); 768 - ubi_msg("logical eraseblock size: %d bytes", ubi->leb_size); 769 - ubi_msg("smallest flash I/O unit: %d", ubi->min_io_size); 770 - if (ubi->hdrs_min_io_size != ubi->min_io_size) 771 - ubi_msg("sub-page size: %d", 772 - ubi->hdrs_min_io_size); 773 - ubi_msg("VID header offset: %d (aligned %d)", 774 - ubi->vid_hdr_offset, ubi->vid_hdr_aloffset); 775 - ubi_msg("data offset: %d", ubi->leb_start); 776 762 777 763 /* 778 764 * Note, ideally, we have to initialize @ubi->bad_peb_count here. But ··· 924 932 spin_lock_init(&ubi->volumes_lock); 925 933 926 934 ubi_msg("attaching mtd%d to ubi%d", mtd->index, ubi_num); 927 - dbg_msg("sizeof(struct ubi_ainf_peb) %zu", sizeof(struct ubi_ainf_peb)); 928 - dbg_msg("sizeof(struct ubi_wl_entry) %zu", sizeof(struct ubi_wl_entry)); 929 935 930 936 err = io_init(ubi, max_beb_per1024); 931 937 if (err) ··· 966 976 goto out_debugfs; 967 977 } 968 978 969 - ubi_msg("attached mtd%d to ubi%d", mtd->index, ubi_num); 970 - ubi_msg("MTD device name: \"%s\"", mtd->name); 971 - ubi_msg("MTD device size: %llu MiB", ubi->flash_size >> 20); 972 - ubi_msg("number of good PEBs: %d", ubi->good_peb_count); 973 - ubi_msg("number of bad PEBs: %d", ubi->bad_peb_count); 974 - ubi_msg("number of corrupted PEBs: %d", ubi->corr_peb_count); 975 - ubi_msg("max. allowed volumes: %d", ubi->vtbl_slots); 976 - ubi_msg("wear-leveling threshold: %d", CONFIG_MTD_UBI_WL_THRESHOLD); 977 - ubi_msg("number of internal volumes: %d", UBI_INT_VOL_COUNT); 978 - ubi_msg("number of user volumes: %d", 979 - ubi->vol_count - UBI_INT_VOL_COUNT); 980 - ubi_msg("available PEBs: %d", ubi->avail_pebs); 981 - ubi_msg("total number of reserved PEBs: %d", ubi->rsvd_pebs); 982 - ubi_msg("number of PEBs reserved for bad PEB handling: %d", 983 - ubi->beb_rsvd_pebs); 984 - ubi_msg("max/mean erase counter: %d/%d", ubi->max_ec, ubi->mean_ec); 985 - ubi_msg("image sequence number: %u", ubi->image_seq); 979 + ubi_msg("attached mtd%d (name \"%s\", size %llu MiB) to ubi%d", 980 + mtd->index, mtd->name, ubi->flash_size >> 20, ubi_num); 981 + ubi_msg("PEB size: %d bytes (%d KiB), LEB size: %d bytes", 982 + ubi->peb_size, ubi->peb_size >> 10, ubi->leb_size); 983 + ubi_msg("min./max. I/O unit sizes: %d/%d, sub-page size %d", 984 + ubi->min_io_size, ubi->max_write_size, ubi->hdrs_min_io_size); 985 + ubi_msg("VID header offset: %d (aligned %d), data offset: %d", 986 + ubi->vid_hdr_offset, ubi->vid_hdr_aloffset, ubi->leb_start); 987 + ubi_msg("good PEBs: %d, bad PEBs: %d, corrupted PEBs: %d", 988 + ubi->good_peb_count, ubi->bad_peb_count, ubi->corr_peb_count); 989 + ubi_msg("user volume: %d, internal volumes: %d, max. volumes count: %d", 990 + ubi->vol_count - UBI_INT_VOL_COUNT, UBI_INT_VOL_COUNT, 991 + ubi->vtbl_slots); 992 + ubi_msg("max/mean erase counter: %d/%d, WL threshold: %d, image sequence number: %u", 993 + ubi->max_ec, ubi->mean_ec, CONFIG_MTD_UBI_WL_THRESHOLD, 994 + ubi->image_seq); 995 + ubi_msg("available PEBs: %d, total reserved PEBs: %d, PEBs reserved for bad PEB handling: %d", 996 + ubi->avail_pebs, ubi->rsvd_pebs, ubi->beb_rsvd_pebs); 986 997 987 998 /* 988 999 * The below lock makes sure we do not race with 'ubi_thread()' which ··· 1060 1069 1061 1070 ubi_assert(ubi_num == ubi->ubi_num); 1062 1071 ubi_notify_all(ubi, UBI_VOLUME_REMOVED, NULL); 1063 - dbg_msg("detaching mtd%d from ubi%d", ubi->mtd->index, ubi_num); 1072 + ubi_msg("detaching mtd%d from ubi%d", ubi->mtd->index, ubi_num); 1064 1073 1065 1074 /* 1066 1075 * Before freeing anything, we have to stop the background thread to
+3 -3
drivers/mtd/ubi/cdev.c
··· 754 754 re->new_name_len = name_len; 755 755 memcpy(re->new_name, name, name_len); 756 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 758 vol_id, re->desc->vol->name, name); 759 759 } 760 760 ··· 812 812 re1->remove = 1; 813 813 re1->desc = desc; 814 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 816 re1->desc->vol->vol_id, re1->desc->vol->name); 817 817 } 818 818 ··· 943 943 { 944 944 struct ubi_rnvol_req *req; 945 945 946 - dbg_msg("re-name volumes"); 946 + dbg_gen("re-name volumes"); 947 947 req = kmalloc(sizeof(struct ubi_rnvol_req), GFP_KERNEL); 948 948 if (!req) { 949 949 err = -ENOMEM;
-5
drivers/mtd/ubi/debug.h
··· 42 42 pr_debug("UBI DBG " type " (pid %d): " fmt "\n", current->pid, \ 43 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 45 /* General debugging messages */ 51 46 #define dbg_gen(fmt, ...) ubi_dbg_msg("gen", fmt, ##__VA_ARGS__) 52 47 /* Messages from the eraseblock association sub-system */
+1 -1
drivers/mtd/ubi/io.c
··· 177 177 * enabled. A corresponding message will be printed 178 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 181 ubi_assert(len == read); 182 182 return UBI_IO_BITFLIPS; 183 183 }
+1 -1
drivers/mtd/ubi/vtbl.c
··· 304 304 struct ubi_vid_hdr *vid_hdr; 305 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 309 vid_hdr = ubi_zalloc_vid_hdr(ubi, GFP_KERNEL); 310 310 if (!vid_hdr)
+1 -1
drivers/mtd/ubi/wl.c
··· 1201 1201 { 1202 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 1206 1206 retry: 1207 1207 spin_lock(&ubi->wl_lock);