From: Greg Kroah-Hartman Date: Mon, 26 Jun 2017 13:41:11 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v3.18.59~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9479eca09ec64d0fbd703093c1914a5c3d0b9a23;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-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-4.9/mtd-spi-nor-fix-spansion-quad-enable.patch b/queue-4.9/mtd-spi-nor-fix-spansion-quad-enable.patch new file mode 100644 index 00000000000..c2fc1f9fc75 --- /dev/null +++ b/queue-4.9/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?= +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 + +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 +Signed-off-by: Cyrille Pitchen +Signed-off-by: Amit Pundir +Signed-off-by: Greg Kroah-Hartman + +--- + 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 +@@ -1255,6 +1255,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.9/of-add-check-to-of_scan_flat_dt-before-accessing-initial_boot_params.patch b/queue-4.9/of-add-check-to-of_scan_flat_dt-before-accessing-initial_boot_params.patch new file mode 100644 index 00000000000..4735cb68d39 --- /dev/null +++ b/queue-4.9/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 +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 + +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 +Cc: Sergei Shtylyov +Cc: linux-mips@linux-mips.org +Patchwork: https://patchwork.linux-mips.org/patch/14605/ +Signed-off-by: Ralf Baechle +Signed-off-by: Amit Pundir +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/of/fdt.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +--- a/drivers/of/fdt.c ++++ b/drivers/of/fdt.c +@@ -741,9 +741,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-4.9/series b/queue-4.9/series index 8f7aaf7cb3f..e3e76eb7dea 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -32,3 +32,5 @@ drm-radeon-add-a-quirk-for-toshiba-satellite-l20-183.patch drm-amdgpu-atom-fix-ps-allocation-size-for-enabledisppowergating.patch drm-amdgpu-adjust-default-display-clock.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