diff options
author | Christian Marangi <ansuelsmth@gmail.com> | 2022-10-21 18:56:08 +0200 |
---|---|---|
committer | Christian Marangi <ansuelsmth@gmail.com> | 2022-10-25 01:29:44 +0200 |
commit | dd2515cb53060e82aee55abe85ac4f50eb481baa (patch) | |
tree | 8b9b821d4e475562a317979f118bd2a5ceb778e3 /target/linux/ipq806x | |
parent | 04a894417812c85e5f21d3637dc5632edaf2cdff (diff) | |
download | upstream-dd2515cb53060e82aee55abe85ac4f50eb481baa.tar.gz upstream-dd2515cb53060e82aee55abe85ac4f50eb481baa.tar.bz2 upstream-dd2515cb53060e82aee55abe85ac4f50eb481baa.zip |
ipq806x: 5.15: backport qcom_nandc patch for unprotected spare data fix
We currently ignore ret of the nandc partition parser if unprotected
spare data is true. This is the case for ipq806x nand.
Backport patch that fix this error and correctly handle error from
partition parser.
Fixes: ae6a63bc97cf ("ipq806x: 5.15: replace nandc patch with upstream version")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Diffstat (limited to 'target/linux/ipq806x')
-rw-r--r-- | target/linux/ipq806x/patches-5.15/130-mtd-nand-raw-qcom_nandc-handle-ret-from-parse-with-c.patch | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/target/linux/ipq806x/patches-5.15/130-mtd-nand-raw-qcom_nandc-handle-ret-from-parse-with-c.patch b/target/linux/ipq806x/patches-5.15/130-mtd-nand-raw-qcom_nandc-handle-ret-from-parse-with-c.patch new file mode 100644 index 0000000000..b6ed7554ce --- /dev/null +++ b/target/linux/ipq806x/patches-5.15/130-mtd-nand-raw-qcom_nandc-handle-ret-from-parse-with-c.patch @@ -0,0 +1,54 @@ +From 99d897e04c0856188e371e60b00e13106cd44a24 Mon Sep 17 00:00:00 2001 +From: Christian Marangi <ansuelsmth@gmail.com> +Date: Fri, 21 Oct 2022 18:38:21 +0200 +Subject: [PATCH] mtd: nand: raw: qcom_nandc: handle ret from parse with + codeword_fixup + +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> +--- + 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 +@@ -3157,16 +3157,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; + } + |