aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/wl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/ubi/wl.c')
-rw-r--r--drivers/mtd/ubi/wl.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c
index 891534f8210d..ec915c02301c 100644
--- a/drivers/mtd/ubi/wl.c
+++ b/drivers/mtd/ubi/wl.c
@@ -756,15 +756,14 @@ static int wear_leveling_worker(struct ubi_device *ubi, struct ubi_work *wrk,
756 756
757 err = ubi_eba_copy_leb(ubi, e1->pnum, e2->pnum, vid_hdr); 757 err = ubi_eba_copy_leb(ubi, e1->pnum, e2->pnum, vid_hdr);
758 if (err) { 758 if (err) {
759 if (err == -EAGAIN) 759 if (err == MOVE_CANCEL_BITFLIPS ||
760 goto out_not_moved; 760 err == MOVE_TARGET_WR_ERR) {
761 if (err < 0) 761 /* Target PEB bit-flips or write error, torture it */
762 goto out_error;
763 if (err == 2) {
764 /* Target PEB write error, torture it */
765 torture = 1; 762 torture = 1;
766 goto out_not_moved; 763 goto out_not_moved;
767 } 764 }
765 if (err < 0)
766 goto out_error;
768 767
769 /* 768 /*
770 * The LEB has not been moved because the volume is being 769 * The LEB has not been moved because the volume is being
@@ -774,7 +773,7 @@ static int wear_leveling_worker(struct ubi_device *ubi, struct ubi_work *wrk,
774 */ 773 */
775 774
776 dbg_wl("canceled moving PEB %d", e1->pnum); 775 dbg_wl("canceled moving PEB %d", e1->pnum);
777 ubi_assert(err == 1); 776 ubi_assert(err == MOVE_CANCEL_RACE);
778 777
779 ubi_free_vid_hdr(ubi, vid_hdr); 778 ubi_free_vid_hdr(ubi, vid_hdr);
780 vid_hdr = NULL; 779 vid_hdr = NULL;