• Alexey Korolev's avatar
    [MTD] [NOR] Fix -ETIMEO errors in CFI driver · 998453fb
    Alexey Korolev authored
    Existing CFI driver has problems with excessive writes during erase.
    If CFI driver does many writes during one erase cycle we may face the
    messages with -ETIMEO error on erase operation.  It may cause the
    following data corruption and kernel panics.
    
    The reason of the issue is related to specifics of suspend operation:
    if we write to flash during erase, suspend operation will cost some time
    to erase procedure (for P30 it could be significant). In current version of
    cfi driver the problem of many suspends is partially workarounded by adding
    some time reserv to any operation (8xerase_time) but if we have many writes
    during one erase the problem appears.
    
    This patch detects the suspend and resets timer if suspend occured. It
    has been well verified on different chips. No problems were found.
    Could you please include the patch as it is simple and fixes bad issue.
    Signed-off-by: default avatarAlexey Korolev <akorolev@infradead.org>
    Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
    998453fb
cfi_cmdset_0001.c 70.2 KB