]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: rawnand: qcom: handle ret from parse with codeword_fixup
authorChristian Marangi <ansuelsmth@gmail.com>
Fri, 21 Oct 2022 16:53:04 +0000 (18:53 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 7 Nov 2022 15:49:15 +0000 (16:49 +0100)
commitdc7a76e44cc494d6b036f5dedb741482d80a78a1
tree4eeb0410e910e20ad850049b680a1e62c18f6f63
parentc57f324991702447d5c9e63bad72c977be3a7287
mtd: rawnand: qcom: 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: b36c841e64f1 ("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
drivers/mtd/nand/raw/qcom_nandc.c