Lines Matching refs:pnum
114 static int add_to_list(struct ubi_attach_info *ai, int pnum, int vol_id, in add_to_list() argument
120 dbg_bld("add to free: PEB %d, EC %d", pnum, ec); in add_to_list()
122 dbg_bld("add to erase: PEB %d, EC %d", pnum, ec); in add_to_list()
124 dbg_bld("add to alien: PEB %d, EC %d", pnum, ec); in add_to_list()
133 aeb->pnum = pnum; in add_to_list()
155 static int add_corrupted(struct ubi_attach_info *ai, int pnum, int ec) in add_corrupted() argument
159 dbg_bld("add to corrupted: PEB %d, EC %d", pnum, ec); in add_corrupted()
166 aeb->pnum = pnum; in add_corrupted()
189 const struct ubi_ainf_volume *av, int pnum) in validate_vid_hdr() argument
234 ubi_err(ubi, "inconsistent VID header at PEB %d", pnum); in validate_vid_hdr()
254 int vol_id, int pnum, in add_volume() argument
320 int pnum, const struct ubi_vid_hdr *vid_hdr) in ubi_compare_lebs() argument
356 pnum); in ubi_compare_lebs()
363 pnum); in ubi_compare_lebs()
371 pnum = aeb->pnum; in ubi_compare_lebs()
372 err = ubi_io_read_vid_hdr(ubi, pnum, vh, 0); in ubi_compare_lebs()
378 pnum, err); in ubi_compare_lebs()
394 err = ubi_io_read_data(ubi, ubi->peb_buf, pnum, 0, len); in ubi_compare_lebs()
402 pnum, crc, data_crc); in ubi_compare_lebs()
407 dbg_bld("PEB %d CRC is OK", pnum); in ubi_compare_lebs()
415 dbg_bld("second PEB %d is newer, copy_flag is set", pnum); in ubi_compare_lebs()
417 dbg_bld("first PEB %d is newer, copy_flag is set", pnum); in ubi_compare_lebs()
444 int ubi_add_to_av(struct ubi_device *ubi, struct ubi_attach_info *ai, int pnum, in ubi_add_to_av() argument
458 pnum, vol_id, lnum, ec, sqnum, bitflips); in ubi_add_to_av()
460 av = add_volume(ai, vol_id, pnum, vid_hdr); in ubi_add_to_av()
491 aeb->pnum, aeb->sqnum, aeb->ec); in ubi_add_to_av()
518 cmp_res = ubi_compare_lebs(ubi, aeb, pnum, vid_hdr); in ubi_add_to_av()
527 err = validate_vid_hdr(ubi, vid_hdr, av, pnum); in ubi_add_to_av()
531 err = add_to_list(ai, aeb->pnum, aeb->vol_id, in ubi_add_to_av()
538 aeb->pnum = pnum; in ubi_add_to_av()
555 return add_to_list(ai, pnum, vol_id, lnum, ec, in ubi_add_to_av()
565 err = validate_vid_hdr(ubi, vid_hdr, av, pnum); in ubi_add_to_av()
574 aeb->pnum = pnum; in ubi_add_to_av()
658 const struct ubi_attach_info *ai, int pnum, int ec) in early_erase_peb() argument
669 pnum, ec); in early_erase_peb()
679 err = ubi_io_sync_erase(ubi, pnum, 0); in early_erase_peb()
683 err = ubi_io_write_ec_hdr(ubi, pnum, ec_hdr); in early_erase_peb()
713 dbg_bld("return free PEB %d, EC %d", aeb->pnum, aeb->ec); in ubi_early_get_peb()
727 err = early_erase_peb(ubi, ai, aeb->pnum, aeb->ec+1); in ubi_early_get_peb()
733 dbg_bld("return PEB %d, EC %d", aeb->pnum, aeb->ec); in ubi_early_get_peb()
759 int pnum) in check_corruption() argument
766 err = ubi_io_read(ubi, ubi->peb_buf, pnum, ubi->leb_start, in check_corruption()
787 pnum); in check_corruption()
791 pnum, ubi->leb_start, ubi->leb_size); in check_corruption()
815 int pnum, int *vid, unsigned long long *sqnum) in scan_peb() argument
820 dbg_bld("scan PEB %d", pnum); in scan_peb()
823 err = ubi_io_is_bad(ubi, pnum); in scan_peb()
831 err = ubi_io_read_ec_hdr(ubi, pnum, ech, 0); in scan_peb()
842 return add_to_list(ai, pnum, UBI_UNKNOWN, UBI_UNKNOWN, in scan_peb()
846 return add_to_list(ai, pnum, UBI_UNKNOWN, UBI_UNKNOWN, in scan_peb()
906 image_seq, pnum, ubi->image_seq); in scan_peb()
914 err = ubi_io_read_vid_hdr(ubi, pnum, vidh, 0); in scan_peb()
952 err = check_corruption(ubi, vidh, pnum); in scan_peb()
958 err = add_to_list(ai, pnum, UBI_UNKNOWN, in scan_peb()
962 err = add_corrupted(ai, pnum, ec); in scan_peb()
967 err = add_to_list(ai, pnum, UBI_UNKNOWN, UBI_UNKNOWN, in scan_peb()
974 err = add_to_list(ai, pnum, UBI_UNKNOWN, in scan_peb()
977 err = add_to_list(ai, pnum, UBI_UNKNOWN, in scan_peb()
1004 err = add_to_list(ai, pnum, vol_id, lnum, in scan_peb()
1019 err = add_to_list(ai, pnum, vol_id, lnum, in scan_peb()
1034 pnum); in scan_peb()
1035 err = ubi_add_to_av(ubi, ai, pnum, ec, vidh, bitflips); in scan_peb()
1081 pr_cont(" %d", aeb->pnum); in late_analysis()
1225 int err, pnum; in scan_all() local
1240 for (pnum = start; pnum < ubi->peb_count; pnum++) { in scan_all()
1243 dbg_gen("process PEB %d", pnum); in scan_all()
1244 err = scan_peb(ubi, ai, pnum, NULL, NULL); in scan_all()
1336 int err, pnum, fm_anchor = -1; in scan_fast() local
1349 for (pnum = 0; pnum < UBI_FM_MAX_START; pnum++) { in scan_fast()
1354 dbg_gen("process PEB %d", pnum); in scan_fast()
1355 err = scan_peb(ubi, *ai, pnum, &vol_id, &sqnum); in scan_fast()
1361 fm_anchor = pnum; in scan_fast()
1501 int pnum, err, vols_found = 0; in self_check_ai() local
1562 if (aeb->pnum < 0 || aeb->ec < 0) { in self_check_ai()
1579 if (aeb->pnum >= ubi->peb_count) { in self_check_ai()
1581 aeb->pnum, ubi->peb_count); in self_check_ai()
1636 err = ubi_io_read_vid_hdr(ubi, aeb->pnum, vidh, 1); in self_check_ai()
1706 for (pnum = 0; pnum < ubi->peb_count; pnum++) { in self_check_ai()
1707 err = ubi_io_is_bad(ubi, pnum); in self_check_ai()
1712 buf[pnum] = 1; in self_check_ai()
1717 buf[aeb->pnum] = 1; in self_check_ai()
1720 buf[aeb->pnum] = 1; in self_check_ai()
1723 buf[aeb->pnum] = 1; in self_check_ai()
1726 buf[aeb->pnum] = 1; in self_check_ai()
1729 buf[aeb->pnum] = 1; in self_check_ai()
1732 for (pnum = 0; pnum < ubi->peb_count; pnum++) in self_check_ai()
1733 if (!buf[pnum]) { in self_check_ai()
1734 ubi_err(ubi, "PEB %d is not referred", pnum); in self_check_ai()