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

Commit 2fd32d4a authored by Kyungmin Park's avatar Kyungmin Park Committed by Artem Bityutskiy
Browse files

[MTD] OneNAND: fix onenand_wait bug in read ecc error



Even though there is ECC error. OneNAND driver updates the buffram as valid

Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
parent 61a7e198
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -298,7 +298,7 @@ static int onenand_wait(struct mtd_info *mtd, int state)
	unsigned long timeout;
	unsigned long timeout;
	unsigned int flags = ONENAND_INT_MASTER;
	unsigned int flags = ONENAND_INT_MASTER;
	unsigned int interrupt = 0;
	unsigned int interrupt = 0;
	unsigned int ctrl, ecc;
	unsigned int ctrl;


	/* The 20 msec is enough */
	/* The 20 msec is enough */
	timeout = jiffies + msecs_to_jiffies(20);
	timeout = jiffies + msecs_to_jiffies(20);
@@ -324,7 +324,7 @@ static int onenand_wait(struct mtd_info *mtd, int state)
	}
	}


	if (interrupt & ONENAND_INT_READ) {
	if (interrupt & ONENAND_INT_READ) {
		ecc = this->read_word(this->base + ONENAND_REG_ECC_STATUS);
		int ecc = this->read_word(this->base + ONENAND_REG_ECC_STATUS);
		if (ecc) {
		if (ecc) {
			DEBUG(MTD_DEBUG_LEVEL0, "onenand_wait: ECC error = 0x%04x\n", ecc);
			DEBUG(MTD_DEBUG_LEVEL0, "onenand_wait: ECC error = 0x%04x\n", ecc);
			if (ecc & ONENAND_ECC_2BIT_ALL)
			if (ecc & ONENAND_ECC_2BIT_ALL)
@@ -332,6 +332,7 @@ static int onenand_wait(struct mtd_info *mtd, int state)
			else if (ecc & ONENAND_ECC_1BIT_ALL)
			else if (ecc & ONENAND_ECC_1BIT_ALL)
				mtd->ecc_stats.corrected++;
				mtd->ecc_stats.corrected++;
		}
		}
		return ecc;
	}
	}


	return 0;
	return 0;