Lines Matching refs:pnum

125 static int self_check_ec(struct ubi_device *ubi, int pnum, int ec);
155 ubi_assert(e->pnum != e1->pnum); in wl_tree_add()
156 if (e->pnum < e1->pnum) in wl_tree_add()
177 ubi->lookuptbl[e->pnum] = NULL; in wl_entry_destroy()
246 if (e->pnum == e1->pnum) { in in_wl_tree()
256 ubi_assert(e->pnum != e1->pnum); in in_wl_tree()
257 if (e->pnum < e1->pnum) in in_wl_tree()
306 dbg_wl("added PEB %d EC %d to the protection queue", e->pnum, e->ec); in prot_queue_add()
400 dbg_wl("PEB %d EC %d", e->pnum, e->ec); in wl_get_wle()
413 static int prot_queue_del(struct ubi_device *ubi, int pnum) in prot_queue_del() argument
417 e = ubi->lookuptbl[pnum]; in prot_queue_del()
425 dbg_wl("deleted PEB %d from the protection queue", e->pnum); in prot_queue_del()
445 dbg_wl("erase PEB %d, old EC %llu", e->pnum, ec); in sync_erase()
447 err = self_check_ec(ubi, e->pnum, e->ec); in sync_erase()
455 err = ubi_io_sync_erase(ubi, e->pnum, torture); in sync_erase()
466 e->pnum, ec); in sync_erase()
471 dbg_wl("erased PEB %d, new EC %llu", e->pnum, ec); in sync_erase()
475 err = ubi_io_write_ec_hdr(ubi, e->pnum, ec_hdr); in sync_erase()
512 e->pnum, e->ec); in serve_prot_queue()
591 e->pnum, e->ec, torture); in schedule_erase()
625 dbg_wl("sync erase of PEB %i", e->pnum); in do_sync_erase()
718 dbg_wl("anchor-move PEB %d to PEB %d", e1->pnum, e2->pnum);
746 e1->pnum, e1->ec, e2->pnum, e2->ec);
757 dbg_wl("scrub PEB %d to PEB %d", e1->pnum, e2->pnum);
775 err = ubi_io_read_vid_hdr(ubi, e1->pnum, vidb, 0);
789 dbg_wl("PEB %d has no VID header", e1->pnum);
799 e1->pnum);
809 e1->pnum);
815 err, e1->pnum);
822 err = ubi_eba_copy_leb(ubi, e1->pnum, e2->pnum, vidb);
879 e1->pnum, vol_id, lnum, e2->pnum);
907 e2->pnum, vol_id, lnum);
926 e1->pnum, vol_id, lnum, e2->pnum, err);
929 e1->pnum, e2->pnum, err);
972 err, e1->pnum, e2->pnum);
975 err, e1->pnum, vol_id, lnum, e2->pnum);
1089 int pnum = e->pnum; local
1095 pnum, e->ec, wl_wrk->vol_id, wl_wrk->lnum);
1102 e->pnum < UBI_FM_MAX_START) {
1127 ubi_err(ubi, "failed to erase PEB %d, error %d", pnum, err);
1159 ubi_err(ubi, "bad physical eraseblock %d detected", pnum);
1175 ubi_msg(ubi, "mark PEB %d as bad", pnum);
1176 err = ubi_io_mark_bad(ubi, pnum);
1224 dbg_wl("cancel erasure of PEB %d EC %d", e->pnum, e->ec);
1249 int pnum, int torture) argument
1254 dbg_wl("PEB %d", pnum);
1255 ubi_assert(pnum >= 0);
1256 ubi_assert(pnum < ubi->peb_count);
1262 e = ubi->lookuptbl[pnum];
1281 dbg_wl("PEB %d is being moved, wait", pnum);
1298 dbg_wl("PEB %d is the target of data moving", pnum);
1319 err = prot_queue_del(ubi, e->pnum);
1321 ubi_err(ubi, "PEB %d not found", pnum);
1352 int ubi_wl_scrub_peb(struct ubi_device *ubi, int pnum) argument
1356 ubi_msg(ubi, "schedule PEB %d for scrubbing", pnum);
1360 e = ubi->lookuptbl[pnum];
1375 dbg_wl("the PEB %d is not in proper tree, retry", pnum);
1386 err = prot_queue_del(ubi, e->pnum);
1388 ubi_err(ubi, "PEB %d not found", pnum);
1501 int ubi_bitflip_check(struct ubi_device *ubi, int pnum, int force) argument
1506 if (pnum < 0 || pnum >= ubi->peb_count) {
1522 e = ubi->lookuptbl[pnum];
1541 err = ubi_io_read(ubi, ubi->peb_buf, pnum, 0, ubi->peb_size);
1555 e = ubi->lookuptbl[pnum];
1572 prot_queue_del(ubi, e->pnum);
1747 e->pnum = aeb->pnum;
1749 ubi->lookuptbl[e->pnum] = e;
1826 e->pnum = aeb->pnum;
1833 ubi->lookuptbl[e->pnum] = e;
1848 e->pnum = aeb->pnum;
1850 ubi->lookuptbl[e->pnum] = e;
1854 e->pnum, e->ec);
1858 e->pnum, e->ec);
1869 e = ubi_find_fm_block(ubi, aeb->pnum);
1872 ubi_assert(!ubi->lookuptbl[e->pnum]);
1873 ubi->lookuptbl[e->pnum] = e;
1883 if (ubi->lookuptbl[aeb->pnum])
1989 static int self_check_ec(struct ubi_device *ubi, int pnum, int ec) argument
2002 err = ubi_io_read_ec_hdr(ubi, pnum, ec_hdr, 0);
2011 ubi_err(ubi, "self-check failed for PEB %d", pnum);
2042 e->pnum, e->ec, root);
2065 e->pnum, e->ec);
2148 err = ubi_self_check_all_ff(ubi, e->pnum, ubi->vid_hdr_aloffset,
2151 ubi_err(ubi, "new PEB %d does not contain all 0xFF bytes", e->pnum);
2155 return e->pnum;