summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Zhu <a2289c@android-hal-04.(none)>2009-10-03 18:50:04 -0500
committerSan Mehat <san@google.com>2009-10-07 17:25:51 -0700
commitac716cdc1d50366f6d628a6d9cb6d8cb9f91dffe (patch)
treef5967d8ee27907391f6f56f9c4aab964632e2e76 /drivers
parentf6e195a306555420312a8b39c9d8e3b7bfdaad15 (diff)
mtd: nand_base: fix nand_panic_wait
fix the problem of nand_panic_wait Signed-off-by: Tom Zhu <a2289c@android-hal-04.(none)> Signed-off-by: San Mehat <san@google.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/nand/nand_base.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 8ba3e3ee5eb6..8d6d033c2aa7 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2524,11 +2524,13 @@ static void nand_panic_wait(struct mtd_info *mtd)
struct nand_chip *chip = mtd->priv;
int i;
- for (i = 0; i < 2000; i++) {
- if (chip->dev_ready(mtd))
- break;
- mdelay(10);
- }
+ if (chip->state != FL_READY)
+ for (i = 0; i < 40; i++) {
+ if (chip->dev_ready(mtd))
+ break;
+ mdelay(10);
+ }
+ chip->state = FL_READY;
}
static int nand_panic_write(struct mtd_info *mtd, loff_t to, size_t len,