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()
346 !ubi->fm && e->pnum < UBI_FM_MAX_START) in find_wl_entry()
408 dbg_wl("PEB %d EC %d", e->pnum, e->ec); in wl_get_wle()
421 static int prot_queue_del(struct ubi_device *ubi, int pnum) in prot_queue_del() argument
425 e = ubi->lookuptbl[pnum]; in prot_queue_del()
433 dbg_wl("deleted PEB %d from the protection queue", e->pnum); in prot_queue_del()
453 dbg_wl("erase PEB %d, old EC %llu", e->pnum, ec); in sync_erase()
455 err = self_check_ec(ubi, e->pnum, e->ec); in sync_erase()
463 err = ubi_io_sync_erase(ubi, e->pnum, torture); in sync_erase()
474 e->pnum, ec); in sync_erase()
479 dbg_wl("erased PEB %d, new EC %llu", e->pnum, ec); in sync_erase()
483 err = ubi_io_write_ec_hdr(ubi, e->pnum, ec_hdr); in sync_erase()
520 e->pnum, e->ec); in serve_prot_queue()
598 e->pnum, e->ec, torture); in schedule_erase()
632 dbg_wl("sync erase of PEB %i", e->pnum); in do_sync_erase()
716 if (e2->pnum < UBI_FM_MAX_START)
721 dbg_wl("anchor-move PEB %d to PEB %d", e1->pnum, e2->pnum);
748 e1->pnum, e1->ec, e2->pnum, e2->ec);
759 dbg_wl("scrub PEB %d to PEB %d", e1->pnum, e2->pnum);
777 err = ubi_io_read_vid_hdr(ubi, e1->pnum, vidb, 0);
791 dbg_wl("PEB %d has no VID header", e1->pnum);
801 e1->pnum);
811 e1->pnum);
817 err, e1->pnum);
824 err = ubi_eba_copy_leb(ubi, e1->pnum, e2->pnum, vidb);
881 e1->pnum, vol_id, lnum, e2->pnum);
906 e2->pnum, vol_id, lnum);
925 e1->pnum, vol_id, lnum, e2->pnum, err);
928 e1->pnum, e2->pnum, err);
971 err, e1->pnum, e2->pnum);
974 err, e1->pnum, vol_id, lnum, e2->pnum);
1085 int pnum = e->pnum; local
1091 pnum, e->ec, wl_wrk->vol_id, wl_wrk->lnum);
1111 ubi_err(ubi, "failed to erase PEB %d, error %d", pnum, err);
1139 ubi_err(ubi, "bad physical eraseblock %d detected", pnum);
1155 ubi_msg(ubi, "mark PEB %d as bad", pnum);
1156 err = ubi_io_mark_bad(ubi, pnum);
1204 dbg_wl("cancel erasure of PEB %d EC %d", e->pnum, e->ec);
1229 int pnum, int torture) argument
1234 dbg_wl("PEB %d", pnum);
1235 ubi_assert(pnum >= 0);
1236 ubi_assert(pnum < ubi->peb_count);
1242 e = ubi->lookuptbl[pnum];
1249 dbg_wl("PEB %d is being moved, wait", pnum);
1266 dbg_wl("PEB %d is the target of data moving", pnum);
1287 err = prot_queue_del(ubi, e->pnum);
1289 ubi_err(ubi, "PEB %d not found", pnum);
1320 int ubi_wl_scrub_peb(struct ubi_device *ubi, int pnum) argument
1324 ubi_msg(ubi, "schedule PEB %d for scrubbing", pnum);
1328 e = ubi->lookuptbl[pnum];
1343 dbg_wl("the PEB %d is not in proper tree, retry", pnum);
1354 err = prot_queue_del(ubi, e->pnum);
1356 ubi_err(ubi, "PEB %d not found", pnum);
1469 int ubi_bitflip_check(struct ubi_device *ubi, int pnum, int force) argument
1474 if (pnum < 0 || pnum >= ubi->peb_count) {
1490 e = ubi->lookuptbl[pnum];
1509 err = ubi_io_read(ubi, ubi->peb_buf, pnum, 0, ubi->peb_size);
1523 e = ubi->lookuptbl[pnum];
1540 prot_queue_del(ubi, e->pnum);
1702 e->pnum = aeb->pnum;
1704 ubi->lookuptbl[e->pnum] = e;
1781 e->pnum = aeb->pnum;
1788 ubi->lookuptbl[e->pnum] = e;
1803 e->pnum = aeb->pnum;
1805 ubi->lookuptbl[e->pnum] = e;
1809 e->pnum, e->ec);
1813 e->pnum, e->ec);
1824 e = ubi_find_fm_block(ubi, aeb->pnum);
1827 ubi_assert(!ubi->lookuptbl[e->pnum]);
1828 ubi->lookuptbl[e->pnum] = e;
1838 if (ubi->lookuptbl[aeb->pnum])
1940 static int self_check_ec(struct ubi_device *ubi, int pnum, int ec) argument
1953 err = ubi_io_read_ec_hdr(ubi, pnum, ec_hdr, 0);
1962 ubi_err(ubi, "self-check failed for PEB %d", pnum);
1993 e->pnum, e->ec, root);
2016 e->pnum, e->ec);
2099 err = ubi_self_check_all_ff(ubi, e->pnum, ubi->vid_hdr_aloffset,
2102 ubi_err(ubi, "new PEB %d does not contain all 0xFF bytes", e->pnum);
2106 return e->pnum;