]> git.baikalelectronics.ru Git - kernel.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)
commitf460f54cbb9cb5e210d3cd8690d97da2f78b7bb2
treedebd45c7cb95e4712ebe52ab12915f3344b1a6e6
parentc56c2aec6b241c6f0a347b2b5bb6a3510dbad530
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