]> git.karo-electronics.de Git - linux-beck.git/commit
mtd: spi-nor: wait until lock/unlock operations are ready
authorEzequiel García <ezequiel@vanguardiasur.com.ar>
Mon, 28 Dec 2015 20:54:51 +0000 (17:54 -0300)
committerBrian Norris <computersforpeace@gmail.com>
Thu, 7 Jan 2016 01:18:34 +0000 (17:18 -0800)
commit32321e950d8a237d7e8f3a9b76220007dfa87544
treedebd45c7cb95e4712ebe52ab12915f3344b1a6e6
parent6e75632ac34d2f63ab586880f7e9747bd9b708a6
mtd: spi-nor: wait until lock/unlock operations are ready

On Micron and Numonyx devices, the status register write command
(WRSR), raises a work-in-progress bit (WIP) on the status register.
The datasheets for these devices specify that while the status
register write is in progress, the status register WIP bit can still
be read to check the end of the operation.

This commit adds a wait_till_ready call on lock/unlock operations,
which is required for Micron and Numonyx but should be harmless for
others. This is needed to prevent applications from issuing erase or
program operations before the unlock operation is completed.

Reported-by: Stas Sergeev <stsp@list.ru>
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/spi-nor/spi-nor.c