• Nicolas Pitre's avatar
    [PATCH] L18 flash corruption fix · 8df3c8e0
    Nicolas Pitre authored
    Another fix to the put_chip() concurrency logic.
    
    Problem was occurring when:
    
    1) one thread was erasing a block in partition x;
    2) another thread suspended the erase in order to write to
       partition y;
    3) a third thread came along to read a different block from
       partition x and, when it called put_chip(), chip->oldstate was
       FL_ERASING and the erase (mistakenly) resumed;
    4) the write in partition y obviously failed at that point.
    
    Incidentally, the fix for this problem also fixed the case where
    suspending writes for MTD XIP usage was not working properly.
    Signed-off-by: default avatarNicolas Pitre <nico@cam.org>
    Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    8df3c8e0
cfi_cmdset_0001.c 59.1 KB