[PATCH] CFI: prevent the false software timeouts on writes
Sergei Shtylylov
sshtylyov at ru.mvista.com
Tue Oct 25 13:33:40 EDT 2005
Hello.
We've noticed that sometimes "MTD do_write_buffer(): software timeout"
message was printed out when writing to a Fujitsu NOR flash.
It turned out that this was because of a race in the timeout handling
do_write_buffer(). A small timeout of (HZ / 1000) + 1 is used there, and
sometimes if the timer interrupt handling takes more than one or even two
jiffies (which is 1-2 ms with HZ == 1000) and that interrupt happens just
after chip_ready() call, the driver bails out from a ready polling loop
despite the chip has actually become ready while all those interrupts were
handled. To deal with this issue, extra check for chip ready is neccessary on
timeout expiration (and the checks should better be reordered).
As do_write_oneword() uses the same approach, it needs to also be changed.
Signed-off-by: Konstantin Baidarov <kbaidarov at ru.mvista.com>
Signed-off-by: Sergei Shtylyov <sshtylyov at ru.mvista.com>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cfi_cmdset_0002-write-timeout.patch
Url: http://lists.infradead.org/pipermail/linux-mtd/attachments/20051025/ea016523/attachment.pl
More information about the linux-mtd
mailing list