aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-04-25 02:15:38 -0400
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-05-20 13:25:58 -0400
commitf01e2d1654dc65792674b3fe5403dbfcce43f9d2 (patch)
tree6aa4a3bef6973f8c404992beb1a242bf7dc300e6
parenta904e3f1deb21b986b7789a830fa8f132ff3d406 (diff)
UBI: always warn if case of I/O errors
Currently UBI silently retries I/O operation in case of errors. This patch makes it emit a warning before retrying. This should allow users notice issues earlier. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
-rw-r--r--drivers/mtd/ubi/io.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c
index a3225c212feb..19ee1a821557 100644
--- a/drivers/mtd/ubi/io.c
+++ b/drivers/mtd/ubi/io.c
@@ -189,9 +189,9 @@ retry:
189 } 189 }
190 190
191 if (retries++ < UBI_IO_RETRIES) { 191 if (retries++ < UBI_IO_RETRIES) {
192 dbg_io("error %d%s while reading %d bytes from PEB " 192 ubi_warn("error %d%s while reading %d bytes from PEB "
193 "%d:%d, read only %zd bytes, retry", 193 "%d:%d, read only %zd bytes, retry",
194 err, errstr, len, pnum, offset, read); 194 err, errstr, len, pnum, offset, read);
195 yield(); 195 yield();
196 goto retry; 196 goto retry;
197 } 197 }
@@ -364,8 +364,8 @@ retry:
364 err = mtd_erase(ubi->mtd, &ei); 364 err = mtd_erase(ubi->mtd, &ei);
365 if (err) { 365 if (err) {
366 if (retries++ < UBI_IO_RETRIES) { 366 if (retries++ < UBI_IO_RETRIES) {
367 dbg_io("error %d while erasing PEB %d, retry", 367 ubi_warn("error %d while erasing PEB %d, retry",
368 err, pnum); 368 err, pnum);
369 yield(); 369 yield();
370 goto retry; 370 goto retry;
371 } 371 }
@@ -383,7 +383,7 @@ retry:
383 383
384 if (ei.state == MTD_ERASE_FAILED) { 384 if (ei.state == MTD_ERASE_FAILED) {
385 if (retries++ < UBI_IO_RETRIES) { 385 if (retries++ < UBI_IO_RETRIES) {
386 dbg_io("error while erasing PEB %d, retry", pnum); 386 ubi_warn("error while erasing PEB %d, retry", pnum);
387 yield(); 387 yield();
388 goto retry; 388 goto retry;
389 } 389 }