]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mtd: spi-nor: wait for SR_WIP to clear on initial unlock
authorBrian Norris <computersforpeace@gmail.com>
Fri, 29 Jan 2016 19:25:30 +0000 (11:25 -0800)
committerBrian Norris <computersforpeace@gmail.com>
Tue, 8 Mar 2016 02:01:50 +0000 (18:01 -0800)
Fixup a piece leftover by commit 32321e950d8a ("mtd: spi-nor: wait until
lock/unlock operations are ready"). That commit made us wait for the WIP
bit to settle after lock/unlock operations, but it missed the open-coded
"unlock" that happens at probe() time.

We should probably have this code utilize the unlock() routines in the
future, to avoid duplication, but unfortunately, flash which need to be
unlocked don't all have a proper ->flash_unlock() callback.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Stas Sergeev <stsp@users.sourceforge.net>
Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Tested-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
drivers/mtd/spi-nor/spi-nor.c

index 03e5e44a0d936fa38da75745bc36073a68fe2bbc..a9b3bdf28c90e33c3bc976ac19f62d602b0f6b02 100644 (file)
@@ -1193,6 +1193,7 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
            JEDEC_MFR(info) == SNOR_MFR_SST) {
                write_enable(nor);
                write_sr(nor, 0);
+               spi_nor_wait_till_ready(nor);
        }
 
        if (!mtd->name)