]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Jun 2017 13:41:10 +0000 (15:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Jun 2017 13:41:10 +0000 (15:41 +0200)
added patches:
mtd-spi-nor-fix-spansion-quad-enable.patch
of-add-check-to-of_scan_flat_dt-before-accessing-initial_boot_params.patch

queue-4.4/mtd-spi-nor-fix-spansion-quad-enable.patch [new file with mode: 0644]
queue-4.4/of-add-check-to-of_scan_flat_dt-before-accessing-initial_boot_params.patch [new file with mode: 0644]
queue-4.4/series

diff --git a/queue-4.4/mtd-spi-nor-fix-spansion-quad-enable.patch b/queue-4.4/mtd-spi-nor-fix-spansion-quad-enable.patch
new file mode 100644 (file)
index 0000000..c626acd
--- /dev/null
@@ -0,0 +1,49 @@
+From 807c16253319ee6ccf8873ae64f070f7eb532cd5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jo=C3=ABl=20Esponde?= <joel.esponde@honeywell.com>
+Date: Wed, 23 Nov 2016 12:47:40 +0100
+Subject: mtd: spi-nor: fix spansion quad enable
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Joël Esponde <joel.esponde@honeywell.com>
+
+commit 807c16253319ee6ccf8873ae64f070f7eb532cd5 upstream.
+
+With the S25FL127S nor flash part, each writing to the configuration
+register takes hundreds of ms. During that  time, no more accesses to
+the flash should be done (even reads).
+
+This commit adds a wait loop after the register writing until the flash
+finishes its work.
+
+This issue could make rootfs mounting fail when the latter was done too
+much closely to this quad enable bit setting step. And in this case, a
+driver as UBIFS may try to recover the filesystem and may broke it
+completely.
+
+Signed-off-by: Joël Esponde <joel.esponde@honeywell.com>
+Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
+Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mtd/spi-nor/spi-nor.c |    7 +++++++
+ 1 file changed, 7 insertions(+)
+
+--- a/drivers/mtd/spi-nor/spi-nor.c
++++ b/drivers/mtd/spi-nor/spi-nor.c
+@@ -1057,6 +1057,13 @@ static int spansion_quad_enable(struct s
+               return -EINVAL;
+       }
++      ret = spi_nor_wait_till_ready(nor);
++      if (ret) {
++              dev_err(nor->dev,
++                      "timeout while writing configuration register\n");
++              return ret;
++      }
++
+       /* read back and check it */
+       ret = read_cr(nor);
+       if (!(ret > 0 && (ret & CR_QUAD_EN_SPAN))) {
diff --git a/queue-4.4/of-add-check-to-of_scan_flat_dt-before-accessing-initial_boot_params.patch b/queue-4.4/of-add-check-to-of_scan_flat_dt-before-accessing-initial_boot_params.patch
new file mode 100644 (file)
index 0000000..0af4876
--- /dev/null
@@ -0,0 +1,43 @@
+From 3ec754410cb3e931a6c4920b1a150f21a94a2bf4 Mon Sep 17 00:00:00 2001
+From: Tobias Wolf <dev-NTEO@vplace.de>
+Date: Wed, 23 Nov 2016 10:40:07 +0100
+Subject: of: Add check to of_scan_flat_dt() before accessing initial_boot_params
+
+From: Tobias Wolf <dev-NTEO@vplace.de>
+
+commit 3ec754410cb3e931a6c4920b1a150f21a94a2bf4 upstream.
+
+An empty __dtb_start to __dtb_end section might result in
+initial_boot_params being null for arch/mips/ralink. This showed that the
+boot process hangs indefinitely in of_scan_flat_dt().
+
+Signed-off-by: Tobias Wolf <dev-NTEO@vplace.de>
+Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Cc: linux-mips@linux-mips.org
+Patchwork: https://patchwork.linux-mips.org/patch/14605/
+Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
+Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/of/fdt.c |    9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+--- a/drivers/of/fdt.c
++++ b/drivers/of/fdt.c
+@@ -632,9 +632,12 @@ int __init of_scan_flat_dt(int (*it)(uns
+       const char *pathp;
+       int offset, rc = 0, depth = -1;
+-        for (offset = fdt_next_node(blob, -1, &depth);
+-             offset >= 0 && depth >= 0 && !rc;
+-             offset = fdt_next_node(blob, offset, &depth)) {
++      if (!blob)
++              return 0;
++
++      for (offset = fdt_next_node(blob, -1, &depth);
++           offset >= 0 && depth >= 0 && !rc;
++           offset = fdt_next_node(blob, offset, &depth)) {
+               pathp = fdt_get_name(blob, offset, NULL);
+               if (*pathp == '/')
index 7e0cedbbc2db6b0d7434abb55ef83d4503be5e10..167143c849e0f43bc3c6a4d1b64b7668a00fc868 100644 (file)
@@ -16,3 +16,5 @@ drm-amdgpu-atom-fix-ps-allocation-size-for-enabledisppowergating.patch
 drm-amdgpu-adjust-default-display-clock.patch
 usb-usbip-fix-nonconforming-hub-descriptor.patch
 rxrpc-fix-several-cases-where-a-padded-len-isn-t-checked-in-ticket-decode.patch
+of-add-check-to-of_scan_flat_dt-before-accessing-initial_boot_params.patch
+mtd-spi-nor-fix-spansion-quad-enable.patch