linux-stable/drivers/mtd/parsers
Linus Walleij 509cbbdec9 mtd: parsers: bcm47xxpart: Fix halfblock reads
[ Upstream commit 05e258c6ec ]

There is some code in the parser that tries to read 0x8000
bytes into a block to "read in the middle" of the block. Well
that only works if the block is also 0x10000 bytes all the time,
else we get these parse errors as we reach the end of the flash:

spi-nor spi0.0: mx25l1606e (2048 Kbytes)
mtd_read error while parsing (offset: 0x200000): -22
mtd_read error while parsing (offset: 0x201000): -22
(...)

Fix the code to do what I think was intended.

Cc: stable@vger.kernel.org
Fixes: f0501e81fb ("mtd: bcm47xxpart: alternative MAGIC for board_data partition")
Cc: Rafał Miłecki <zajec5@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20221018091129.280026-1-linus.walleij@linaro.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-11-10 18:15:32 +01:00
..
afs.c
ar7part.c
bcm47xxpart.c mtd: parsers: bcm47xxpart: Fix halfblock reads 2022-11-10 18:15:32 +01:00
bcm63xxpart.c
cmdlinepart.c
Kconfig
Makefile
ofpart_bcm4908.c
ofpart_bcm4908.h
ofpart_core.c
ofpart_linksys_ns.c
ofpart_linksys_ns.h
parser_imagetag.c
parser_trx.c
qcomsmempart.c
redboot.c
sharpslpart.c