generic: spi-nor: rework broken-flash-reset

Instead of resetting flash to 3B address on remove hook, this
implementation only enters 4B mode when needed, which prevents more
unexpected reboot stuck. This implementation makes it only break when
a kernel panic happens during flash operation on 16M+ areas.
Also silent broken-flash-reset warning. We are not dealing with vendors
and it's unpleasant for users to see that unnecessary and long WARN_ON
print.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
This commit is contained in:
Chuanhong Guo
2020-04-06 18:28:10 +08:00
parent 4f34e430ed
commit dfa521f129
2 changed files with 168 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -2238,6 +2238,11 @@ static const struct flash_info spi_nor_i
@@ -2265,6 +2265,11 @@ static const struct flash_info spi_nor_i
SPI_NOR_4B_OPCODES | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
.fixups = &gd25q256_fixups,
},