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

Commit a87f29cb authored by Artem Bityutskiy's avatar Artem Bityutskiy
Browse files

UBI: always re-read in case of read failures



When the read operation fails, UBI tries to re-read several times in
a hope that one of the subsequent reads may succeed. However, currently
UBI re-reads only if MTD failed to read all data, but does not re-reads
if all the data were read, but with an integrity error (-EBADMSB). This
patch makes UBI to always re-try reading.

This should be useful for reading NAND pages with unstable bits -
re-reading may help to get correct data.

Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent fef2deb3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -188,7 +188,7 @@ int ubi_io_read(const struct ubi_device *ubi, void *buf, int pnum, int offset,
			return UBI_IO_BITFLIPS;
		}

		if (read != len && retries++ < UBI_IO_RETRIES) {
		if (retries++ < UBI_IO_RETRIES) {
			dbg_io("error %d%s while reading %d bytes from PEB %d:%d,"
			       " read only %zd bytes, retry",
			       err, errstr, len, pnum, offset, read);