linux/drivers/mtd
Linus Walleij 05e258c6ec mtd: parsers: bcm47xxpart: Fix halfblock reads
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
2022-10-18 11:20:12 +02:00
..
chips mtd: cfi_cmdset_0002: Rename chip_ready variables 2022-04-28 10:17:22 +02:00
devices mtd: add ECC error accounting for each read request 2022-09-21 10:38:09 +02:00
hyperbus mtd: hyperbus: rpc-if: Fix RPM imbalance in probe error path 2022-06-24 20:47:36 +02:00
lpddr mtd: lpddr2_nvm: Warn about failure to unregister mtd device 2022-06-09 15:06:16 +02:00
maps Core MTD changes: 2022-10-07 11:59:11 -07:00
nand mtd: rawnand: marvell: Use correct logic for nand-keep-config 2022-10-18 10:31:00 +02:00
parsers mtd: parsers: bcm47xxpart: Fix halfblock reads 2022-10-18 11:20:12 +02:00
spi-nor mtd: spi-nor: core: Ignore -ENOTSUPP in spi_nor_init() 2022-10-18 10:11:35 +02:00
tests treewide: use get_random_bytes() when possible 2022-10-11 17:42:58 -06:00
ubi Random number generator fixes for Linux 6.1-rc1. 2022-10-16 15:27:07 -07:00
ftl.c mtd: ftl: use container_of() rather than cast 2022-09-19 18:14:53 +02:00
inftlcore.c mtd: always initialize 'stats' in struct mtd_oob_ops 2022-09-21 10:38:07 +02:00
inftlmount.c mtd: inftl: remove unnecessary oom message 2021-06-11 20:44:21 +02:00
Kconfig mtdblock: Add comment about UBI block devices 2021-08-06 22:05:13 +02:00
Makefile mtd: Support kmsg dumper based on pstore/blk 2020-05-31 19:49:01 -07:00
mtd_blkdevs.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
mtdblock_ro.c mtdblock: Warn if added for a NAND device 2021-08-17 18:41:59 +02:00
mtdblock.c mtdblock: warn if opened on NAND 2022-04-25 10:43:12 +02:00
mtdchar.c mtdchar: add MEMREAD ioctl 2022-09-21 10:38:11 +02:00
mtdconcat.c mtd: fix repeated word in comment 2022-09-20 10:40:30 +02:00
mtdcore.c mtd: core: add missing of_node_get() in dynamic partitions code 2022-10-18 10:16:38 +02:00
mtdcore.h mtd: Provide fs_context-aware mount_mtd() replacement 2019-09-05 14:34:23 -04:00
mtdoops.c mtd: mtdoops: Add a timestamp to the mtdoops header. 2022-04-26 09:27:12 +02:00
mtdpart.c mtd: call of_platform_populate() for MTD partitions 2022-05-16 18:37:48 +02:00
mtdpstore.c mtd: Fix a typo in a comment 2022-09-19 18:14:53 +02:00
mtdsuper.c mm: don't include <linux/blkdev.h> in <linux/backing-dev.h> 2021-10-18 06:17:01 -06:00
mtdswap.c mtd: always initialize 'stats' in struct mtd_oob_ops 2022-09-21 10:38:07 +02:00
nftlcore.c mtd: always initialize 'stats' in struct mtd_oob_ops 2022-09-21 10:38:07 +02:00
nftlmount.c mtd: nftl: remove unnecessary oom message 2021-06-11 20:43:26 +02:00
rfd_ftl.c mtd/rfd_ftl: don't cast away the type when calling add_mtd_blktrans_dev 2021-08-23 10:01:06 +02:00
sm_ftl.c mtd: always initialize 'stats' in struct mtd_oob_ops 2022-09-21 10:38:07 +02:00
sm_ftl.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ssfdc.c mtd: always initialize 'stats' in struct mtd_oob_ops 2022-09-21 10:38:07 +02:00