[MTD] OneNAND: Fix unlock all status error

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Feb 9 09:59:02 EST 2007


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=10b7a2bd6bf3510cbb5977a44d8822f085738729
Commit:     10b7a2bd6bf3510cbb5977a44d8822f085738729
Parent:     9cdf083f981b8d37b3212400a359368661385099
Author:     Kyungmin Park <kyungmin.park at samsung.com>
AuthorDate: Fri Jan 12 05:45:34 2007 +0900
Committer:  Kyungmin Park <kyungmin.park at samsung.com>
CommitDate: Thu Jan 18 10:59:16 2007 +0900

    [MTD] OneNAND: Fix unlock all status error
    
    We have to set ONENAND_REG_START_BLOCK_ADDRESS to avoid status error
    
    Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
---
 drivers/mtd/onenand/onenand_base.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index 2da6bb2..d0f3118 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -1491,6 +1491,8 @@ static int onenand_unlock_all(struct mtd_info *mtd)
 	struct onenand_chip *this = mtd->priv;
 
 	if (this->options & ONENAND_HAS_UNLOCK_ALL) {
+		/* Set start block address */
+		this->write_word(0, this->base + ONENAND_REG_START_BLOCK_ADDRESS);
 		/* Write unlock command */
 		this->command(mtd, ONENAND_CMD_UNLOCK_ALL, 0, 0);
 
@@ -1504,12 +1506,9 @@ static int onenand_unlock_all(struct mtd_info *mtd)
 
 		/* Workaround for all block unlock in DDP */
 		if (this->device_id & ONENAND_DEVICE_IS_DDP) {
-			loff_t ofs;
-			size_t len;
-
 			/* 1st block on another chip */
-			ofs = this->chipsize >> 1;
-			len = 1 << this->erase_shift;
+			loff_t ofs = this->chipsize >> 1;
+			size_t len = mtd->erasesize;
 
 			onenand_unlock(mtd, ofs, len);
 		}



More information about the linux-mtd-cvs mailing list