3.18-stable patches

added patches:
	mtd-spi-nor-fix-spansion-quad-enable.patch
	of-add-check-to-of_scan_flat_dt-before-accessing-initial_boot_params.patch
diff --git a/queue-3.18/mtd-spi-nor-fix-spansion-quad-enable.patch b/queue-3.18/mtd-spi-nor-fix-spansion-quad-enable.patch
new file mode 100644
index 0000000..4513bc0
--- /dev/null
+++ b/queue-3.18/mtd-spi-nor-fix-spansion-quad-enable.patch
@@ -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
+@@ -864,6 +864,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-3.18/of-add-check-to-of_scan_flat_dt-before-accessing-initial_boot_params.patch b/queue-3.18/of-add-check-to-of_scan_flat_dt-before-accessing-initial_boot_params.patch
new file mode 100644
index 0000000..8b457fa
--- /dev/null
+++ b/queue-3.18/of-add-check-to-of_scan_flat_dt-before-accessing-initial_boot_params.patch
@@ -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
+@@ -585,9 +585,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 == '/')
diff --git a/queue-3.18/series b/queue-3.18/series
index 29fdbc0..f8c235a 100644
--- a/queue-3.18/series
+++ b/queue-3.18/series
@@ -8,3 +8,5 @@
 input-i8042-add-fujitsu-lifebook-ah544-to-notimeout-list.patch
 target-fix-kref-refcount-underflow-in-transport_cmd_finish_abort.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