소스 검색

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: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Artem Bityutskiy 14 년 전
부모
커밋
a87f29cbbc
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      drivers/mtd/ubi/io.c

+ 1 - 1
drivers/mtd/ubi/io.c

@@ -188,7 +188,7 @@ retry:
 			return UBI_IO_BITFLIPS;
 			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,"
 			dbg_io("error %d%s while reading %d bytes from PEB %d:%d,"
 			       " read only %zd bytes, retry",
 			       " read only %zd bytes, retry",
 			       err, errstr, len, pnum, offset, read);
 			       err, errstr, len, pnum, offset, read);