linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Revert "mtd: spi-nor: Disable the flash quad mode in spi_nor_restore()"
@ 2020-09-04  7:47 Yicong Yang
  2020-09-04  7:47 ` [PATCH 2/2] Revert "mtd: spi-nor: Add capability to disable flash quad mode" Yicong Yang
  2020-09-17  9:20 ` [PATCH 1/2] Revert "mtd: spi-nor: Disable the flash quad mode in spi_nor_restore()" Vignesh Raghavendra
  0 siblings, 2 replies; 3+ messages in thread
From: Yicong Yang @ 2020-09-04  7:47 UTC (permalink / raw)
  To: m.weisser.m, vigneshr, p.yadav, tudor.ambarus
  Cc: linux-mtd, linuxarm, yangyicong

Previous patch intends to restore the flash's QE bit when removed/shutdown,
but may have some problems and break the flash:

- for those originally in Quad mode, this patch will clear the QE bit
  when unloaded the flash, which is incorrect.
- even with above problem solved, it may still break the flash as some
  flash's QE bit is non-volatile and lots of set/reset will wear out
  the bit.
- the restore method cannot be proved to be valid as if a hard
  reset or accident crash happened, the spi_nor_restore() won't be
  performed the the QE bit will not be restored as we expected to.

So let's revert it to fix this. The discussion can be found at [1].

This reverts commit cc59e6bb6cd69d3347c06ccce088c5c6052e041e.

[1] https://lore.kernel.org/linux-mtd/CAO8h3eFLVLRmw7u+rurKsg7=Nh2q-HVq-HgVXig8gf5Dffk8MA@mail.gmail.com/
Reported-by: Matthias Weisser <m.weisser.m@gmail.com>
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Suggested-by: Vignesh Raghavendra <vigneshr@ti.com>
---
 drivers/mtd/spi-nor/core.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index 65eff4c..ab8f554 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -3000,8 +3000,6 @@ void spi_nor_restore(struct spi_nor *nor)
 	if (nor->addr_width == 4 && !(nor->flags & SNOR_F_4B_OPCODES) &&
 	    nor->flags & SNOR_F_BROKEN_RESET)
 		nor->params->set_4byte_addr_mode(nor, false);
-
-	spi_nor_quad_enable(nor, false);
 }
 EXPORT_SYMBOL_GPL(spi_nor_restore);
 
-- 
2.8.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-17  9:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-04  7:47 [PATCH 1/2] Revert "mtd: spi-nor: Disable the flash quad mode in spi_nor_restore()" Yicong Yang
2020-09-04  7:47 ` [PATCH 2/2] Revert "mtd: spi-nor: Add capability to disable flash quad mode" Yicong Yang
2020-09-17  9:20 ` [PATCH 1/2] Revert "mtd: spi-nor: Disable the flash quad mode in spi_nor_restore()" Vignesh Raghavendra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).