[MTD] Fix default timeouts for Intel NOR flash
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Fri Feb 9 09:59:06 EST 2007
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=2a5bd596723e13b3f25b9a7f46e9541577bd42c7
Commit: 2a5bd596723e13b3f25b9a7f46e9541577bd42c7
Parent: c1f1625860847b57a0450a28d112423c2af675ff
Author: David Woodhouse <dwmw2 at infradead.org>
AuthorDate: Fri Feb 9 14:39:10 2007 +0000
Committer: David Woodhouse <dwmw2 at infradead.org>
CommitDate: Fri Feb 9 14:39:10 2007 +0000
[MTD] Fix default timeouts for Intel NOR flash
In commit c172471b78255a5cf6d05383d9ebbf0c6683167a Nico switched to using
common code for polling for command completion. Unfortunately he also used
a common default timeout for both write and erase commands, despite the
fact that erases can take a _whole_ lot longer. Use a more sensible
default for erase timeout.
Signed-off-by: David Woodhouse <dwmw2 at infradead.org>
---
drivers/mtd/chips/cfi_cmdset_0001.c | 20 +++++++++++++++++---
1 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index f69184a..d402625 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -397,9 +397,23 @@ struct mtd_info *cfi_cmdset_0001(struct map_info *map, int primary)
cfi_fixup(mtd, fixup_table);
for (i=0; i< cfi->numchips; i++) {
- cfi->chips[i].word_write_time = 1<<cfi->cfiq->WordWriteTimeoutTyp;
- cfi->chips[i].buffer_write_time = 1<<cfi->cfiq->BufWriteTimeoutTyp;
- cfi->chips[i].erase_time = 1000<<cfi->cfiq->BlockEraseTimeoutTyp;
+ if (cfi->cfiq->WordWriteTimeoutTyp)
+ cfi->chips[i].word_write_time =
+ 1<<cfi->cfiq->WordWriteTimeoutTyp;
+ else
+ cfi->chips[i].word_write_time = 50000;
+
+ if (cfi->cfiq->BufWriteTimeoutTyp)
+ cfi->chips[i].buffer_write_time =
+ 1<<cfi->cfiq->BufWriteTimeoutTyp;
+ /* No default; if it isn't specified, we won't use it */
+
+ if (cfi->cfiq->BlockEraseTimeoutTyp)
+ cfi->chips[i].erase_time =
+ 1000<<cfi->cfiq->BlockEraseTimeoutTyp;
+ else
+ cfi->chips[i].erase_time = 2000000;
+
cfi->chips[i].ref_point_counter = 0;
init_waitqueue_head(&(cfi->chips[i].wq));
}
More information about the linux-mtd-cvs
mailing list