Skip to contentSkip to conversation

mtd: nand: pxa3xx: Fix for wait time out caused by READOOB

PATCH New Greg Cook 1 participant 1 message Dec 12, 2017

Subsystems (2)
lore
Share & tools
lore

Greg Cook

author
#0 lore raw

PATCH 1/1 mtd: nand: pxa3xx: Fix for wait time out caused by READOOB

From: Greg Cook <[email protected]>

Fix in prepare_set_command() for READOOB to ensure hardware FIFO is completely drained. Fix in drain_fifo() for non-ECC operations.

---
 drivers/mtd/nand/pxa3xx_nand.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/mtd/nand/pxa3xx_nand.c +7 -2
index 021374f..cfa8c71 100644
@@ -677,7 +677,7 @@ static void disable_int(struct pxa3xx_nand_info *info, uint32_t int_mask)
 
 static void drain_fifo(struct pxa3xx_nand_info *info, void *data, int len)
 {
-	if (info->ecc_bch) {
+	if (info->use_ecc && info->ecc_bch) {
 		u32 val;
 		int ret;
 
@@ -1023,7 +1023,12 @@ static int prepare_set_command(struct pxa3xx_nand_info *info, int command,
 
 		if (info->cur_chunk < info->nfullchunks) {
 			info->step_chunk_size = info->chunk_size;
-			info->step_spare_size = info->spare_size;
+			if (info->use_ecc) {
+				info->step_spare_size = info->spare_size;
+			} else {
+				info->step_spare_size = info->spare_size
+							+ info->ecc_size;
+			}
 		} else {
 			info->step_chunk_size = info->last_chunk_size;
 			info->step_spare_size = info->last_spare_size;
Signature · 1 line
2.9.5