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

Commit 9d032801 authored by Adrian Hunter's avatar Adrian Hunter Committed by Kyungmin Park
Browse files

[MTD] OneNAND: Return an error if a read timeout occurs



If OneNAND is operating within specification, all operations should easily be
completed within the 20 millisecond timeout.
This patch faithlessly adds a check for the timeout and returns an error in
that case.

Signed-off-by: default avatarAdrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
parent 10b7a2bd
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -333,6 +333,9 @@ static int onenand_wait(struct mtd_info *mtd, int state)
			} else if (ecc & ONENAND_ECC_1BIT_ALL)
				mtd->ecc_stats.corrected++;
		}
	} else if (state == FL_READING) {
		printk(KERN_ERR "onenand_wait: read timeout! ctrl=0x%04x intr=0x%04x\n", ctrl, interrupt);
		return -EIO;
	}

	return 0;