From: Brian Norris Date: Fri, 29 Jan 2016 19:25:30 +0000 (-0800) Subject: mtd: spi-nor: wait for SR_WIP to clear on initial unlock X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=edf891ef9ab773363f8e58022a26d7d31604aed6;p=linux-beck.git mtd: spi-nor: wait for SR_WIP to clear on initial unlock 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 Cc: Stas Sergeev Reviewed-by: Ezequiel Garcia Tested-by: Ezequiel Garcia --- diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 03e5e44a0d93..a9b3bdf28c90 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -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)