mtd: fix recovery after failed write-buffer operation in cfi_cmdset_0002.c
commit070c32223ae8a724a190ea769104ea41567e3673
authorHarald Nordgard-Hansen <hhansen@pvv.org>
Fri, 23 Nov 2012 22:11:03 +0000 (23 23:11 +0100)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Mon, 3 Dec 2012 14:36:52 +0000 (3 16:36 +0200)
treec1c9141fb81b69dbb66dcb6006a884bf81347c0f
parentff3206b2450499203532af2505a7f6f8413e92c0
mtd: fix recovery after failed write-buffer operation in cfi_cmdset_0002.c

When working on a problem with some flash chips that lock up during
write-buffer operations, I think there may be a bug in the linux
handling of chips using cfi_cmdset_0002.c.

The datasheets I have found for a number of these chips all specify that
when aborting a write-buffer command, it is not enough to use the
standard reset.  Rather a "write-to-buffer-reset command" is needed.
This command is quite similar for all chips, the main variance seem to
be if the final 0xF0 can go to any address or must go to addr_unlock1.

The bug is then in the recovery handling when timing out at the end of
do_write_buffer, where using the normal reset command is not sufficient.

Without this change, if the write-buffer command fails then any
following operations on the flash also fail.

Signed-off-by: Harald Nordgard-Hansen <hhansen@pvv.org>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
drivers/mtd/chips/cfi_cmdset_0002.c