]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.0-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Nov 2022 09:17:01 +0000 (10:17 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Nov 2022 09:17:01 +0000 (10:17 +0100)
added patches:

queue-6.0/mtd-rawnand-qcom-handle-ret-from-parse-with-codeword_fixup.patch [new file with mode: 0644]
queue-6.0/series [new file with mode: 0644]

diff --git a/queue-6.0/mtd-rawnand-qcom-handle-ret-from-parse-with-codeword_fixup.patch b/queue-6.0/mtd-rawnand-qcom-handle-ret-from-parse-with-codeword_fixup.patch
new file mode 100644 (file)
index 0000000..8db2555
--- /dev/null
@@ -0,0 +1,60 @@
+From 7df140e84a75c89962feef659d686303d3ce75e5 Mon Sep 17 00:00:00 2001
+From: Christian Marangi <ansuelsmth@gmail.com>
+Date: Fri, 21 Oct 2022 18:53:04 +0200
+Subject: mtd: rawnand: qcom: handle ret from parse with codeword_fixup
+
+From: Christian Marangi <ansuelsmth@gmail.com>
+
+commit 7df140e84a75c89962feef659d686303d3ce75e5 upstream.
+
+With use_codeword_fixup enabled, any return from
+mtd_device_parse_register gets overwritten. Aside from the clear bug, this
+is also problematic as a parser can EPROBE_DEFER and because this is not
+correctly handled, the nand is never rescanned later in the bootup
+process.
+
+An example of this problem is when smem requires additional time to be
+probed and nandc use qcomsmempart as parser. Parser will return
+EPROBE_DEFER but in the current code this ret gets overwritten by
+qcom_nand_host_parse_boot_partitions and qcom_nand_host_init_and_register
+return 0.
+
+Correctly handle the return code from mtd_device_parse_register so that
+any error from this function is not ignored.
+
+Fixes: 862bdedd7f4b ("mtd: nand: raw: qcom_nandc: add support for unprotected spare data pages")
+Cc: stable@vger.kernel.org # v6.0+
+Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
+Link: https://lore.kernel.org/linux-mtd/20221021165304.19991-1-ansuelsmth@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/mtd/nand/raw/qcom_nandc.c |   12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+--- a/drivers/mtd/nand/raw/qcom_nandc.c
++++ b/drivers/mtd/nand/raw/qcom_nandc.c
+@@ -3167,16 +3167,18 @@ static int qcom_nand_host_init_and_regis
+       ret = mtd_device_parse_register(mtd, probes, NULL, NULL, 0);
+       if (ret)
+-              nand_cleanup(chip);
++              goto err;
+       if (nandc->props->use_codeword_fixup) {
+               ret = qcom_nand_host_parse_boot_partitions(nandc, host, dn);
+-              if (ret) {
+-                      nand_cleanup(chip);
+-                      return ret;
+-              }
++              if (ret)
++                      goto err;
+       }
++      return 0;
++
++err:
++      nand_cleanup(chip);
+       return ret;
+ }
diff --git a/queue-6.0/series b/queue-6.0/series
new file mode 100644 (file)
index 0000000..98fc249
--- /dev/null
@@ -0,0 +1 @@
+mtd-rawnand-qcom-handle-ret-from-parse-with-codeword_fixup.patch