mtd: rawnand: Fix and simplify again the continuous read derivations
authorMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 23 Feb 2024 11:55:43 +0000 (12:55 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 14 Mar 2024 23:04:50 +0000 (00:04 +0100)
commitc7ee7c8d4b60fe46d4861b1200bc1c7ab657960a
tree547dfd3f8a500da6690a90c1fa77ff6d8ec2a2bc
parentc9692ebf6253c1d7325f287b268c4a1882136393
mtd: rawnand: Fix and simplify again the continuous read derivations

We need to avoid the first page if we don't read it entirely.
We need to avoid the last page if we don't read it entirely.
While rather simple, this logic has been failed in the previous
fix. This time I wrote about 30 unit tests locally to check each
possible condition, hopefully I covered them all.

Reported-by: Christophe Kerello <christophe.kerello@foss.st.com>
Closes: https://lore.kernel.org/linux-mtd/20240221175327.42f7076d@xps-13/T/#m399bacb10db8f58f6b1f0149a1df867ec086bb0a
Suggested-by: Christophe Kerello <christophe.kerello@foss.st.com>
Fixes: 828f6df1bcba ("mtd: rawnand: Clarify conditions to enable continuous reads")
Cc: stable@vger.kernel.org
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Tested-by: Christophe Kerello <christophe.kerello@foss.st.com>
Link: https://lore.kernel.org/linux-mtd/20240223115545.354541-2-miquel.raynal@bootlin.com
drivers/mtd/nand/raw/nand_base.c