Index: drivers/mtd/chips/cfi_cmdset_0002.c =================================================================== RCS file: /home/cvs/mtd/drivers/mtd/chips/cfi_cmdset_0002.c,v retrieving revision 1.120 diff -a -u -p -r1.120 cfi_cmdset_0002.c --- drivers/mtd/chips/cfi_cmdset_0002.c 20 Jul 2005 21:01:13 -0000 1.120 +++ drivers/mtd/chips/cfi_cmdset_0002.c 25 Oct 2005 15:38:44 -0000 @@ -1014,16 +1014,16 @@ static int __xipram do_write_oneword(str continue; } - if (chip_ready(map, adr)) - break; - - if (time_after(jiffies, timeo)) { + if (time_after(jiffies, timeo) && !chip_ready(map, adr)){ xip_enable(map, chip, adr); printk(KERN_WARNING "MTD %s(): software timeout\n", __func__); xip_disable(map, chip, adr); - break; + break; } + if (chip_ready(map, adr)) + break; + /* Latency issues. Drop the lock, wait a while and retry */ UDELAY(map, chip, adr, 1); } @@ -1275,13 +1275,13 @@ static int __xipram do_write_buffer(stru continue; } + if (time_after(jiffies, timeo) && !chip_ready(map, adr)) + break; + if (chip_ready(map, adr)) { xip_enable(map, chip, adr); goto op_done; } - - if( time_after(jiffies, timeo)) - break; /* Latency issues. Drop the lock, wait a while and retry */ UDELAY(map, chip, adr, 1);