kernel: Move an upstreamed patch under backports
authorMauri Sandberg <sandberg@mailfence.com>
Fri, 16 Apr 2021 14:52:59 +0000 (17:52 +0300)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 30 Apr 2021 21:48:37 +0000 (23:48 +0200)
This CFI patch was accepted upstream for 5.13. Move it away from under
ath79 and place under backports to be removed in due time.

Signed-off-by: Mauri Sandberg <sandberg@mailfence.com>
target/linux/ath79/patches-5.10/471-mtd-cfi_cmdset_0002-AMD-chip-0x2201-write-words.patch [deleted file]
target/linux/ath79/patches-5.4/471-mtd-cfi_cmdset_0002-AMD-chip-0x2201-write-words.patch [deleted file]
target/linux/generic/backport-5.10/408-v5.13-mtd-cfi_cmdset_0002-Disable-buffered-writes-for-AMD.patch [new file with mode: 0644]
target/linux/generic/backport-5.4/408-v5.13-mtd-cfi_cmdset_0002-Disable-buffered-writes-for-AMD.patch [new file with mode: 0644]
target/linux/generic/pending-5.10/460-mtd-cfi_cmdset_0002-no-erase_suspend.patch
target/linux/generic/pending-5.10/461-mtd-cfi_cmdset_0002-add-buffer-write-cmd-timeout.patch
target/linux/generic/pending-5.4/460-mtd-cfi_cmdset_0002-no-erase_suspend.patch
target/linux/generic/pending-5.4/461-mtd-cfi_cmdset_0002-add-buffer-write-cmd-timeout.patch

diff --git a/target/linux/ath79/patches-5.10/471-mtd-cfi_cmdset_0002-AMD-chip-0x2201-write-words.patch b/target/linux/ath79/patches-5.10/471-mtd-cfi_cmdset_0002-AMD-chip-0x2201-write-words.patch
deleted file mode 100644 (file)
index 35ea92a..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-From f1f811410af297c848e9ec17eaa280d190fdce10 Mon Sep 17 00:00:00 2001
-From: Mauri Sandberg <sandberg@mailfence.com>
-Date: Tue, 23 Feb 2021 18:09:31 +0200
-Subject: [PATCH] mtd: cfi_cmdset_0002: AMD chip 0x2201 - write words
-
-Buffer writes do not work with AMD chip 0x2201. The chip in question
-is a AMD/Spansion/Cypress Semiconductor S29GL256N and datasheet [1]
-talks about writing buffers being possible. While waiting for a neater
-solution resort to writing word-sized chunks only.
-
-Without the patch kernel logs will be flooded with entries like below:
-
-jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
-jffs2_build_filesystem(): unlocking the mtd device...
-done.
-jffs2_build_filesystem(): erasing all blocks after the end marker...
-MTD do_write_buffer_wait(): software timeout, address:0x01ec000a.
-jffs2: Write clean marker to block at 0x01920000 failed: -5
-MTD do_write_buffer_wait(): software timeout, address:0x01e2000a.
-jffs2: Write clean marker to block at 0x01880000 failed: -5
-MTD do_write_buffer_wait(): software timeout, address:0x01e0000a.
-jffs2: Write clean marker to block at 0x01860000 failed: -5
-MTD do_write_buffer_wait(): software timeout, address:0x01dc000a.
-jffs2: Write clean marker to block at 0x01820000 failed: -5
-MTD do_write_buffer_wait(): software timeout, address:0x01da000a.
-jffs2: Write clean marker to block at 0x01800000 failed: -5
-...
-
-Tested on a Buffalo wzr-hp-g300nh running kernel 5.10.16.
-
-[1] https://www.cypress.com/file/219941/download
-or  https://datasheetspdf.com/pdf-file/565708/SPANSION/S29GL256N/1
-
-Signed-off-by: Mauri Sandberg <sandberg@mailfence.com>
----
- drivers/mtd/chips/cfi_cmdset_0002.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
---- a/drivers/mtd/chips/cfi_cmdset_0002.c
-+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
-@@ -272,6 +272,10 @@ static void fixup_use_write_buffers(stru
- {
-       struct map_info *map = mtd->priv;
-       struct cfi_private *cfi = map->fldrv_priv;
-+
-+      if ((cfi->mfr == CFI_MFR_AMD) && (cfi->id == 0x2201))
-+              return;
-+
-       if (cfi->cfiq->BufWriteTimeoutTyp) {
-               pr_debug("Using buffer write method\n");
-               mtd->_write = cfi_amdstd_write_buffers;
diff --git a/target/linux/ath79/patches-5.4/471-mtd-cfi_cmdset_0002-AMD-chip-0x2201-write-words.patch b/target/linux/ath79/patches-5.4/471-mtd-cfi_cmdset_0002-AMD-chip-0x2201-write-words.patch
deleted file mode 100644 (file)
index 35ea92a..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-From f1f811410af297c848e9ec17eaa280d190fdce10 Mon Sep 17 00:00:00 2001
-From: Mauri Sandberg <sandberg@mailfence.com>
-Date: Tue, 23 Feb 2021 18:09:31 +0200
-Subject: [PATCH] mtd: cfi_cmdset_0002: AMD chip 0x2201 - write words
-
-Buffer writes do not work with AMD chip 0x2201. The chip in question
-is a AMD/Spansion/Cypress Semiconductor S29GL256N and datasheet [1]
-talks about writing buffers being possible. While waiting for a neater
-solution resort to writing word-sized chunks only.
-
-Without the patch kernel logs will be flooded with entries like below:
-
-jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
-jffs2_build_filesystem(): unlocking the mtd device...
-done.
-jffs2_build_filesystem(): erasing all blocks after the end marker...
-MTD do_write_buffer_wait(): software timeout, address:0x01ec000a.
-jffs2: Write clean marker to block at 0x01920000 failed: -5
-MTD do_write_buffer_wait(): software timeout, address:0x01e2000a.
-jffs2: Write clean marker to block at 0x01880000 failed: -5
-MTD do_write_buffer_wait(): software timeout, address:0x01e0000a.
-jffs2: Write clean marker to block at 0x01860000 failed: -5
-MTD do_write_buffer_wait(): software timeout, address:0x01dc000a.
-jffs2: Write clean marker to block at 0x01820000 failed: -5
-MTD do_write_buffer_wait(): software timeout, address:0x01da000a.
-jffs2: Write clean marker to block at 0x01800000 failed: -5
-...
-
-Tested on a Buffalo wzr-hp-g300nh running kernel 5.10.16.
-
-[1] https://www.cypress.com/file/219941/download
-or  https://datasheetspdf.com/pdf-file/565708/SPANSION/S29GL256N/1
-
-Signed-off-by: Mauri Sandberg <sandberg@mailfence.com>
----
- drivers/mtd/chips/cfi_cmdset_0002.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
---- a/drivers/mtd/chips/cfi_cmdset_0002.c
-+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
-@@ -272,6 +272,10 @@ static void fixup_use_write_buffers(stru
- {
-       struct map_info *map = mtd->priv;
-       struct cfi_private *cfi = map->fldrv_priv;
-+
-+      if ((cfi->mfr == CFI_MFR_AMD) && (cfi->id == 0x2201))
-+              return;
-+
-       if (cfi->cfiq->BufWriteTimeoutTyp) {
-               pr_debug("Using buffer write method\n");
-               mtd->_write = cfi_amdstd_write_buffers;
diff --git a/target/linux/generic/backport-5.10/408-v5.13-mtd-cfi_cmdset_0002-Disable-buffered-writes-for-AMD.patch b/target/linux/generic/backport-5.10/408-v5.13-mtd-cfi_cmdset_0002-Disable-buffered-writes-for-AMD.patch
new file mode 100644 (file)
index 0000000..3af641e
--- /dev/null
@@ -0,0 +1,54 @@
+From 7e4404113686868858a34210c28ae122e967aa64 Mon Sep 17 00:00:00 2001
+From: Mauri Sandberg <sandberg@mailfence.com>
+Date: Tue, 9 Mar 2021 19:48:59 +0200
+Subject: [PATCH] mtd: cfi_cmdset_0002: Disable buffered writes for AMD chip
+ 0x2201
+
+Buffer writes do not work with AMD chip 0x2201. The chip in question
+is a AMD/Spansion/Cypress Semiconductor S29GL256N and datasheet [1]
+talks about writing buffers being possible. While waiting for a neater
+solution resort to writing word-sized chunks only.
+
+Without the patch kernel logs will be flooded with entries like below:
+
+jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
+jffs2_build_filesystem(): unlocking the mtd device...
+done.
+jffs2_build_filesystem(): erasing all blocks after the end marker...
+MTD do_write_buffer_wait(): software timeout, address:0x01ec000a.
+jffs2: Write clean marker to block at 0x01920000 failed: -5
+MTD do_write_buffer_wait(): software timeout, address:0x01e2000a.
+jffs2: Write clean marker to block at 0x01880000 failed: -5
+MTD do_write_buffer_wait(): software timeout, address:0x01e0000a.
+jffs2: Write clean marker to block at 0x01860000 failed: -5
+MTD do_write_buffer_wait(): software timeout, address:0x01dc000a.
+jffs2: Write clean marker to block at 0x01820000 failed: -5
+MTD do_write_buffer_wait(): software timeout, address:0x01da000a.
+jffs2: Write clean marker to block at 0x01800000 failed: -5
+...
+
+Tested on a Buffalo wzr-hp-g300nh running kernel 5.10.16.
+
+[1] https://www.cypress.com/file/219941/download
+or  https://datasheetspdf.com/pdf-file/565708/SPANSION/S29GL256N/1
+
+Signed-off-by: Mauri Sandberg <sandberg@mailfence.com>
+Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
+Link: https://lore.kernel.org/r/20210309174859.362060-1-sandberg@mailfence.com
+---
+ drivers/mtd/chips/cfi_cmdset_0002.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/mtd/chips/cfi_cmdset_0002.c
++++ b/drivers/mtd/chips/cfi_cmdset_0002.c
+@@ -272,6 +272,10 @@ static void fixup_use_write_buffers(stru
+ {
+       struct map_info *map = mtd->priv;
+       struct cfi_private *cfi = map->fldrv_priv;
++
++      if (cfi->mfr == CFI_MFR_AMD && cfi->id == 0x2201)
++              return;
++
+       if (cfi->cfiq->BufWriteTimeoutTyp) {
+               pr_debug("Using buffer write method\n");
+               mtd->_write = cfi_amdstd_write_buffers;
diff --git a/target/linux/generic/backport-5.4/408-v5.13-mtd-cfi_cmdset_0002-Disable-buffered-writes-for-AMD.patch b/target/linux/generic/backport-5.4/408-v5.13-mtd-cfi_cmdset_0002-Disable-buffered-writes-for-AMD.patch
new file mode 100644 (file)
index 0000000..3af641e
--- /dev/null
@@ -0,0 +1,54 @@
+From 7e4404113686868858a34210c28ae122e967aa64 Mon Sep 17 00:00:00 2001
+From: Mauri Sandberg <sandberg@mailfence.com>
+Date: Tue, 9 Mar 2021 19:48:59 +0200
+Subject: [PATCH] mtd: cfi_cmdset_0002: Disable buffered writes for AMD chip
+ 0x2201
+
+Buffer writes do not work with AMD chip 0x2201. The chip in question
+is a AMD/Spansion/Cypress Semiconductor S29GL256N and datasheet [1]
+talks about writing buffers being possible. While waiting for a neater
+solution resort to writing word-sized chunks only.
+
+Without the patch kernel logs will be flooded with entries like below:
+
+jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
+jffs2_build_filesystem(): unlocking the mtd device...
+done.
+jffs2_build_filesystem(): erasing all blocks after the end marker...
+MTD do_write_buffer_wait(): software timeout, address:0x01ec000a.
+jffs2: Write clean marker to block at 0x01920000 failed: -5
+MTD do_write_buffer_wait(): software timeout, address:0x01e2000a.
+jffs2: Write clean marker to block at 0x01880000 failed: -5
+MTD do_write_buffer_wait(): software timeout, address:0x01e0000a.
+jffs2: Write clean marker to block at 0x01860000 failed: -5
+MTD do_write_buffer_wait(): software timeout, address:0x01dc000a.
+jffs2: Write clean marker to block at 0x01820000 failed: -5
+MTD do_write_buffer_wait(): software timeout, address:0x01da000a.
+jffs2: Write clean marker to block at 0x01800000 failed: -5
+...
+
+Tested on a Buffalo wzr-hp-g300nh running kernel 5.10.16.
+
+[1] https://www.cypress.com/file/219941/download
+or  https://datasheetspdf.com/pdf-file/565708/SPANSION/S29GL256N/1
+
+Signed-off-by: Mauri Sandberg <sandberg@mailfence.com>
+Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
+Link: https://lore.kernel.org/r/20210309174859.362060-1-sandberg@mailfence.com
+---
+ drivers/mtd/chips/cfi_cmdset_0002.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/mtd/chips/cfi_cmdset_0002.c
++++ b/drivers/mtd/chips/cfi_cmdset_0002.c
+@@ -272,6 +272,10 @@ static void fixup_use_write_buffers(stru
+ {
+       struct map_info *map = mtd->priv;
+       struct cfi_private *cfi = map->fldrv_priv;
++
++      if (cfi->mfr == CFI_MFR_AMD && cfi->id == 0x2201)
++              return;
++
+       if (cfi->cfiq->BufWriteTimeoutTyp) {
+               pr_debug("Using buffer write method\n");
+               mtd->_write = cfi_amdstd_write_buffers;
index 659a6386aef8ba6d19533caa49d0b5c1cf8ee71a..9983971af5b4935c2dfdd14ebe79b81422023540 100644 (file)
@@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/drivers/mtd/chips/cfi_cmdset_0002.c
 +++ b/drivers/mtd/chips/cfi_cmdset_0002.c
-@@ -909,7 +909,7 @@ static int get_chip(struct map_info *map
+@@ -913,7 +913,7 @@ static int get_chip(struct map_info *map
                return 0;
  
        case FL_ERASING:
index 79276b1b87945f04692299974d9ae3a71818ab2c..0bda2ed971c0ad5cff867d561a12c5cfb661f980 100644 (file)
@@ -7,7 +7,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
  1 file changed, 1 insertion(+)
 --- a/drivers/mtd/chips/cfi_cmdset_0002.c
 +++ b/drivers/mtd/chips/cfi_cmdset_0002.c
-@@ -2053,6 +2053,7 @@ static int __xipram do_write_buffer(stru
+@@ -2057,6 +2057,7 @@ static int __xipram do_write_buffer(stru
  
        /* Write Buffer Load */
        map_write(map, CMD(0x25), cmd_adr);
index 659a6386aef8ba6d19533caa49d0b5c1cf8ee71a..9983971af5b4935c2dfdd14ebe79b81422023540 100644 (file)
@@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/drivers/mtd/chips/cfi_cmdset_0002.c
 +++ b/drivers/mtd/chips/cfi_cmdset_0002.c
-@@ -909,7 +909,7 @@ static int get_chip(struct map_info *map
+@@ -913,7 +913,7 @@ static int get_chip(struct map_info *map
                return 0;
  
        case FL_ERASING:
index 8d2195e13324316c6222e5d3ff2074d7da3e3f00..bedd53ccbaee685d38c6153455310c5bc05716bb 100644 (file)
@@ -7,7 +7,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
  1 file changed, 1 insertion(+)
 --- a/drivers/mtd/chips/cfi_cmdset_0002.c
 +++ b/drivers/mtd/chips/cfi_cmdset_0002.c
-@@ -2054,6 +2054,7 @@ static int __xipram do_write_buffer(stru
+@@ -2058,6 +2058,7 @@ static int __xipram do_write_buffer(stru
  
        /* Write Buffer Load */
        map_write(map, CMD(0x25), cmd_adr);