On Tue, 2020-04-28 at 09:42:56 UTC, Miquel Raynal wrote: > During ONFI detection, the CRC derived from the parameter page and the > CRC supposed to be at the end of the parameter page are compared. If > they do not match, the second then the third copies of the page are > tried. > > The current implementation compares the newly derived CRC with the CRC > contained in the first page only. So if this particular CRC area has > been corrupted, then the detection will fail for a wrong reason. > > Fix this issue by checking the derived CRC against the right one. > > Fixes: 39138c1f4a31 ("mtd: rawnand: use bit-wise majority to recover the ONFI param page") > Cc: stable@xxxxxxxxxxxxxxx > Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx> > Reviewed-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx> Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next. Miquel