Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2b9f56d authored by Nikhilesh Reddy's avatar Nikhilesh Reddy Committed by Gerrit - the friendly Code Review server
Browse files

UBI: Do not re-erase the PEB before writing the VID header



Do not re-erase the PEB before writing the VID header since this
can have some issues with the EBA subsystem.

Change-Id: Id3c701bd5d137e247c73291673998dd9259655ca
Signed-off-by: default avatarNikhilesh Reddy <reddyn@codeaurora.org>
parent 03ffbf10
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -1101,16 +1101,6 @@ int ubi_io_write_vid_hdr(struct ubi_device *ubi, int pnum,
	dbg_io("write VID header to PEB %d", pnum);
	ubi_assert(pnum >= 0 &&  pnum < ubi->peb_count);

	/*
	 * Re-erase the PEB before using it. This should minimize any issues
	 * from decay of charge in this block.
	 */
	if (ubi->wl_is_inited) {
		err = ubi_wl_erase_peb(ubi, pnum);
		if (err)
			return err;
	}

	err = self_check_peb_ec_hdr(ubi, pnum);
	if (err)
		return err;
+0 −1
Original line number Diff line number Diff line
@@ -871,7 +871,6 @@ ssize_t ubi_wl_scrub_all(struct ubi_device *ubi,
void ubi_wl_update_peb_sqnum(struct ubi_device *ubi, int pnum,
				struct ubi_vid_hdr *vid_hdr);
unsigned long long ubi_wl_scrub_get_min_sqnum(struct ubi_device *ubi);
int ubi_wl_erase_peb(struct ubi_device *ubi, int pnum);

/* io.c */
int ubi_io_read(const struct ubi_device *ubi, void *buf, int pnum, int offset,
+0 −18
Original line number Diff line number Diff line
@@ -488,24 +488,6 @@ out_free:
	return err;
}

/**
 * ubi_wl_erase_peb - synchronously erase a physical eraseblock.
 * @ubi: UBI device description object
 * @pnum: the the physical eraseblock number to erase
 *
 * This function returns zero in case of success and a negative error code in
 * case of failure.
 */
int ubi_wl_erase_peb(struct ubi_device *ubi, int pnum)
{
	struct ubi_wl_entry *e;

	spin_lock(&ubi->wl_lock);
	e = ubi->lookuptbl[pnum];
	spin_unlock(&ubi->wl_lock);
	return sync_erase(ubi, e, 0);
}

/**
 * serve_prot_queue - check if it is time to stop protecting PEBs.
 * @ubi: UBI device description object