• Home
  • Raw
  • Download

Lines Matching refs:pnum

191 struct ubi_ainf_peb *ubi_alloc_aeb(struct ubi_attach_info *ai, int pnum,  in ubi_alloc_aeb()  argument
200 aeb->pnum = pnum; in ubi_alloc_aeb()
242 static int add_to_list(struct ubi_attach_info *ai, int pnum, int vol_id, in add_to_list() argument
248 dbg_bld("add to free: PEB %d, EC %d", pnum, ec); in add_to_list()
250 dbg_bld("add to erase: PEB %d, EC %d", pnum, ec); in add_to_list()
252 dbg_bld("add to alien: PEB %d, EC %d", pnum, ec); in add_to_list()
257 aeb = ubi_alloc_aeb(ai, pnum, ec); in add_to_list()
281 static int add_corrupted(struct ubi_attach_info *ai, int pnum, int ec) in add_corrupted() argument
285 dbg_bld("add to corrupted: PEB %d, EC %d", pnum, ec); in add_corrupted()
287 aeb = ubi_alloc_aeb(ai, pnum, ec); in add_corrupted()
309 static int add_fastmap(struct ubi_attach_info *ai, int pnum, in add_fastmap() argument
314 aeb = ubi_alloc_aeb(ai, pnum, ec); in add_fastmap()
322 dbg_bld("add to fastmap list: PEB %d, vol_id %d, sqnum: %llu", pnum, in add_fastmap()
345 const struct ubi_ainf_volume *av, int pnum) in validate_vid_hdr() argument
390 ubi_err(ubi, "inconsistent VID header at PEB %d", pnum); in validate_vid_hdr()
410 int vol_id, int pnum, in add_volume() argument
452 int pnum, const struct ubi_vid_hdr *vid_hdr) in ubi_compare_lebs() argument
488 pnum); in ubi_compare_lebs()
495 pnum); in ubi_compare_lebs()
503 pnum = aeb->pnum; in ubi_compare_lebs()
504 err = ubi_io_read_vid_hdr(ubi, pnum, vidb, 0); in ubi_compare_lebs()
510 pnum, err); in ubi_compare_lebs()
526 err = ubi_io_read_data(ubi, ubi->peb_buf, pnum, 0, len); in ubi_compare_lebs()
534 pnum, crc, data_crc); in ubi_compare_lebs()
539 dbg_bld("PEB %d CRC is OK", pnum); in ubi_compare_lebs()
547 dbg_bld("second PEB %d is newer, copy_flag is set", pnum); in ubi_compare_lebs()
549 dbg_bld("first PEB %d is newer, copy_flag is set", pnum); in ubi_compare_lebs()
576 int ubi_add_to_av(struct ubi_device *ubi, struct ubi_attach_info *ai, int pnum, in ubi_add_to_av() argument
590 pnum, vol_id, lnum, ec, sqnum, bitflips); in ubi_add_to_av()
592 av = add_volume(ai, vol_id, pnum, vid_hdr); in ubi_add_to_av()
623 aeb->pnum, aeb->sqnum, aeb->ec); in ubi_add_to_av()
650 cmp_res = ubi_compare_lebs(ubi, aeb, pnum, vid_hdr); in ubi_add_to_av()
659 err = validate_vid_hdr(ubi, vid_hdr, av, pnum); in ubi_add_to_av()
663 err = add_to_list(ai, aeb->pnum, aeb->vol_id, in ubi_add_to_av()
670 aeb->pnum = pnum; in ubi_add_to_av()
687 return add_to_list(ai, pnum, vol_id, lnum, ec, in ubi_add_to_av()
697 err = validate_vid_hdr(ubi, vid_hdr, av, pnum); in ubi_add_to_av()
701 aeb = ubi_alloc_aeb(ai, pnum, ec); in ubi_add_to_av()
785 const struct ubi_attach_info *ai, int pnum, int ec) in early_erase_peb() argument
796 pnum, ec); in early_erase_peb()
806 err = ubi_io_sync_erase(ubi, pnum, 0); in early_erase_peb()
810 err = ubi_io_write_ec_hdr(ubi, pnum, ec_hdr); in early_erase_peb()
840 dbg_bld("return free PEB %d, EC %d", aeb->pnum, aeb->ec); in ubi_early_get_peb()
854 err = early_erase_peb(ubi, ai, aeb->pnum, aeb->ec+1); in ubi_early_get_peb()
860 dbg_bld("return PEB %d, EC %d", aeb->pnum, aeb->ec); in ubi_early_get_peb()
886 int pnum) in check_corruption() argument
893 err = ubi_io_read(ubi, ubi->peb_buf, pnum, ubi->leb_start, in check_corruption()
914 pnum); in check_corruption()
918 pnum, ubi->leb_start, ubi->leb_size); in check_corruption()
955 int pnum, bool fast) in scan_peb() argument
963 dbg_bld("scan PEB %d", pnum); in scan_peb()
966 err = ubi_io_is_bad(ubi, pnum); in scan_peb()
974 err = ubi_io_read_ec_hdr(ubi, pnum, ech, 0); in scan_peb()
985 return add_to_list(ai, pnum, UBI_UNKNOWN, UBI_UNKNOWN, in scan_peb()
989 return add_to_list(ai, pnum, UBI_UNKNOWN, UBI_UNKNOWN, in scan_peb()
1049 image_seq, pnum, ubi->image_seq); in scan_peb()
1057 err = ubi_io_read_vid_hdr(ubi, pnum, vidb, 0); in scan_peb()
1109 err = check_corruption(ubi, vidh, pnum); in scan_peb()
1115 err = add_to_list(ai, pnum, UBI_UNKNOWN, in scan_peb()
1119 err = add_corrupted(ai, pnum, ec); in scan_peb()
1124 err = add_to_list(ai, pnum, UBI_UNKNOWN, UBI_UNKNOWN, in scan_peb()
1131 err = add_to_list(ai, pnum, UBI_UNKNOWN, in scan_peb()
1134 err = add_to_list(ai, pnum, UBI_UNKNOWN, in scan_peb()
1155 err = add_to_list(ai, pnum, vol_id, lnum, in scan_peb()
1170 err = add_to_list(ai, pnum, vol_id, lnum, in scan_peb()
1185 pnum); in scan_peb()
1188 err = add_fastmap(ai, pnum, vidh, ec); in scan_peb()
1190 err = ubi_add_to_av(ubi, ai, pnum, ec, vidh, bitflips); in scan_peb()
1237 pr_cont(" %d", aeb->pnum); in late_analysis()
1389 int err, pnum; in scan_all() local
1404 for (pnum = start; pnum < ubi->peb_count; pnum++) { in scan_all()
1407 dbg_gen("process PEB %d", pnum); in scan_all()
1408 err = scan_peb(ubi, ai, pnum, false); in scan_all()
1501 int err, pnum; in scan_fast() local
1518 for (pnum = 0; pnum < UBI_FM_MAX_START; pnum++) { in scan_fast()
1521 dbg_gen("process PEB %d", pnum); in scan_fast()
1522 err = scan_peb(ubi, scan_ai, pnum, true); in scan_fast()
1674 int pnum, err, vols_found = 0; in self_check_ai() local
1735 if (aeb->pnum < 0 || aeb->ec < 0) { in self_check_ai()
1752 if (aeb->pnum >= ubi->peb_count) { in self_check_ai()
1754 aeb->pnum, ubi->peb_count); in self_check_ai()
1809 err = ubi_io_read_vid_hdr(ubi, aeb->pnum, vidb, 1); in self_check_ai()
1879 for (pnum = 0; pnum < ubi->peb_count; pnum++) { in self_check_ai()
1880 err = ubi_io_is_bad(ubi, pnum); in self_check_ai()
1885 buf[pnum] = 1; in self_check_ai()
1890 buf[aeb->pnum] = 1; in self_check_ai()
1893 buf[aeb->pnum] = 1; in self_check_ai()
1896 buf[aeb->pnum] = 1; in self_check_ai()
1899 buf[aeb->pnum] = 1; in self_check_ai()
1902 buf[aeb->pnum] = 1; in self_check_ai()
1905 for (pnum = 0; pnum < ubi->peb_count; pnum++) in self_check_ai()
1906 if (!buf[pnum]) { in self_check_ai()
1907 ubi_err(ubi, "PEB %d is not referred", pnum); in self_check_ai()