Skip to contentSkip to conversation

OneNAND: Return an error if a read timeout occurs

PATCH New Adrian Hunter 1 participant 1 message Jan 10, 2007 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
drivers/mtd/onenand/onenand_base.c | 3 +++

1 files changed, 3 insertions(+), 0 deletions(-)
drivers/mtd/onenand/onenand_base.c +0 -0
index 02ad959..ff85a4f 100644
@@ -333,6 +333,9 @@ static int onenand_wait(struct mtd_info 
			} 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;
Signature · 1 line
1.4.3