Patch MTD: increase time out value for buffer program

Changming Chen (changmingche) changmingche at micron.com
Wed Jun 13 00:29:39 EDT 2012


The time out value(1ms:typical HZ defined smaller than 1000) defined for function "do_write_buffer" in "cfi_cmdset_0002.c" is not enough. Because the enlargement of buffer size, much time will cost for buffer program. It's has risk that time out will be triggered before buffer program finished and make misjudge for buffer program. we suggest that 4ms is more appropriate compare to 1ms. This change has no impact of program performance.

diff --git a/a/drivers/mtd/chips/cfi_cmdset_0002.c b/b/drivers/mtd/chips/cfi_cmd
index 9d93c45..7da8fca 100755
--- a/a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -1312,7 +1312,7 @@ static int __xipram do_write_buffer(struct map_info *map, 
         struct cfi_private *cfi = map->fldrv_priv;
         unsigned long timeo = jiffies + HZ;
         /* see comments in do_write_oneword() regarding uWriteTimeo. */
-        unsigned long uWriteTimeout = ( HZ / 1000 ) + 1;
+        unsigned long uWriteTimeout = ( HZ / 1000 ) + 4;
         int ret = -EIO;
         unsigned long cmd_adr;
         int z, words;

Best Regards!
chenchangming

Tel:+86-21-3899-7193
E-Mail:changmingche at micron.com



More information about the linux-mtd mailing list