[U-Boot-Users] [PATCH] NAND testing: chip->state does not always get set.

Fixes an issue with chip->state not always being set causing troubles.
Signed-off-by: Marcel Ziswiler marcel@ziswiler.com --- drivers/mtd/nand/nand_base.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index bfd5cac..4a61fee 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -768,6 +768,7 @@ nand_get_device(struct nand_chip *chip, struct mtd_info *mtd, int new_state) #else static int nand_get_device (struct nand_chip *this, struct mtd_info *mtd, int new_state) { + this->state = new_state; return 0; } #endif @@ -1649,6 +1650,9 @@ static int nand_write_page(struct mtd_info *mtd, struct nand_chip *chip, */ cached = 0;
+ /* Somehow chip->state does not always get set causing troubles. */ + chip->state = FL_WRITING; + if (!cached || !(chip->options & NAND_CACHEPRG)) {
chip->cmdfunc(mtd, NAND_CMD_PAGEPROG, -1, -1);

On Sun, Jun 22, 2008 at 04:30:06PM +0200, Marcel Ziswiler wrote:
Fixes an issue with chip->state not always being set causing troubles.
Signed-off-by: Marcel Ziswiler marcel@ziswiler.com
drivers/mtd/nand/nand_base.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index bfd5cac..4a61fee 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -768,6 +768,7 @@ nand_get_device(struct nand_chip *chip, struct mtd_info *mtd, int new_state) #else static int nand_get_device (struct nand_chip *this, struct mtd_info *mtd, int new_state) {
- this->state = new_state; return 0;
} #endif @@ -1649,6 +1650,9 @@ static int nand_write_page(struct mtd_info *mtd, struct nand_chip *chip, */ cached = 0;
- /* Somehow chip->state does not always get set causing troubles. */
- chip->state = FL_WRITING;
Is this still needed with the above change to nand_get_device()? If so, we should figure out why.
-Scott

On Sun, Jun 22, 2008 at 04:30:06PM +0200, Marcel Ziswiler wrote:
Fixes an issue with chip->state not always being set causing troubles.
Signed-off-by: Marcel Ziswiler marcel@ziswiler.com
drivers/mtd/nand/nand_base.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index bfd5cac..4a61fee 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -768,6 +768,7 @@ nand_get_device(struct nand_chip *chip, struct mtd_info *mtd, int new_state) #else static int nand_get_device (struct nand_chip *this, struct mtd_info *mtd, int new_state) {
- this->state = new_state; return 0;
} #endif
Applied this portion to nand-flash/testing.
-Scott
participants (2)
-
Marcel Ziswiler
-
Scott Wood