From 2c7ca5cc3624e05a5235f70039adce30725972d6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Qi=20Wang=20=E7=8E=8B=E8=B5=B7=20=28qiwang=29?= Date: Wed, 1 Jan 2014 13:06:11 +0000 Subject: [PATCH] UBI: avoid program operation on NOR flash after erasure interrupted MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit nor_erase_prepare() will be called before erase a NOR flash, it will program '0' into a block to mark this block. But program data into a erasure interrupted block can cause program timtout(several minutes at most) error, could impact other operation on NOR flash. So UBIFS can read this block first to avoid unneeded program operation. This patch try to put read operation at head of write operation in nor_erase_prepare(), read out the data. If the data is already corrupt, then no need to program any data into this block, just go to erase this block. This patch is validated on Micron NOR flash, part number is:JS28F512M29EWHA Signed-off-by: Qi Wang Signed-off-by: Artem Bityutskiy --- Reading git-format-patch failed