[OpenWrt-Devel] [PATCH 2/3] ipq40xx: mtd m25p80: fix hang on device shutdown

Daniel Danzberger daniel at dd-wrt.com
Wed Oct 30 07:27:25 EDT 2019


Signed-off-by: Daniel Danzberger <daniel at dd-wrt.com>
---
 .../401-mtd-m25p80-fix-shutdown-hang.patch    | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 target/linux/ipq40xx/patches-4.19/401-mtd-m25p80-fix-shutdown-hang.patch

diff --git a/target/linux/ipq40xx/patches-4.19/401-mtd-m25p80-fix-shutdown-hang.patch b/target/linux/ipq40xx/patches-4.19/401-mtd-m25p80-fix-shutdown-hang.patch
new file mode 100644
index 0000000000..779f7ec4af
--- /dev/null
+++ b/target/linux/ipq40xx/patches-4.19/401-mtd-m25p80-fix-shutdown-hang.patch
@@ -0,0 +1,21 @@
+diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
+index 270d3c95..39f90436 100644
+--- a/drivers/mtd/devices/m25p80.c
++++ b/drivers/mtd/devices/m25p80.c
+@@ -256,9 +256,16 @@ static int m25p_remove(struct spi_mem *spimem)
+ static void m25p_shutdown(struct spi_mem *spimem)
+ {
+ 	struct m25p *flash = spi_mem_get_drvdata(spimem);
++	u8 command[1];
++
++	command[0] = 0x66;
++	spi_write(spimem->spi, command, 1);
++	command[0] = 0x99;
++	spi_write(spimem->spi, command, 1);
+
+ 	spi_nor_restore(&flash->spi_nor);
+ }
++
+ /*
+  * Do NOT add to this array without reading the following:
+  *
-- 
2.23.0


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list