linux/drivers/mtd
Richard Genoud c00c38073c mtd: rawnand: sunxi: fix sunxi_nfc_hw_ecc_read_extra_oob
[ Upstream commit 848c13996c ]

When dumping the OOB, the bytes at the end where actually copied from
the beginning of the OOB instead of current_offset.

That leads to something like:
OOB: ff ff ff ff ff ff ff ff ea 19 00 3a 83 db aa 8d
OOB: 99 09 c8 9a 90 36 35 7d aa 15 13 07 3d 97 b2 a4
OOB: a8 bb 19 b3 07 e9 f6 25 52 d7 1a 23 e2 7e 0a e4
OOB: 52 8a 09 d2 1a 86 3d cf b4 99 43 13 d3 90 33 0b
OOB: ff ff ff ff ff ff ff ff ea 19 00 3a 83 db aa 8d
OOB: 99 09 c8 9a 90 36 35 7d aa 15 13 07 3d 97 b2 a4
OOB: a8 bb 19 b3 07 e9 f6 25 52 d7 1a 23 e2 7e 0a e4
OOB: 52 8a 09 d2 1a 86 3d cf b4 99 43 13 d3 90 33 0b
instead of:
OOB: ff ff ff ff ff ff ff ff ea 19 00 3a 83 db aa 8d
OOB: 99 09 c8 9a 90 36 35 7d aa 15 13 07 3d 97 b2 a4
OOB: a8 bb 19 b3 07 e9 f6 25 52 d7 1a 23 e2 7e 0a e4
OOB: 52 8a 09 d2 1a 86 3d cf b4 99 43 13 d3 90 33 0b
OOB: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
OOB: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
OOB: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
OOB: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
(example with BCH16, user data [8,0], no scrambling)

*cur_off (offset from the beginning of the page) was compared to offset
(offset from the beginning of the OOB), and then, the
nand_change_read_column_op() sets the current position to the beginning
of the OOB instead of OOB+offset

Fixes: 15d6f11828 ("mtd: rawnand: sunxi: Stop supporting ECC_HW_SYNDROME mode")
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Richard Genoud <richard.genoud@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-06-01 17:35:35 +02:00
..
chips mtd: cfi_cmdset_0001: Byte swap OTP info 2023-11-28 16:56:31 +00:00
devices mtd: docg3: fix use-after-free in docg3_release() 2026-06-01 17:35:17 +02:00
hyperbus mtd: hyperbus: hbmc-am654: fix an OF node reference leak 2025-03-13 12:50:09 +01:00
lpddr mtd: lpddr_cmds: fix signed shifts in lpddr_cmds 2026-01-19 13:09:36 +01:00
maps mtd: physmap_of_gemini: Fix disabled pinctrl state check 2026-06-01 17:35:34 +02:00
nand mtd: rawnand: sunxi: fix sunxi_nfc_hw_ecc_read_extra_oob 2026-06-01 17:35:35 +02:00
parsers mtd: parsers: ofpart: call of_node_get() for dedicated subpartitions 2026-06-01 17:35:35 +02:00
spi-nor mtd: spi-nor: swp: check SR_TB flag when getting tb_mask 2026-06-01 17:35:34 +02:00
tests mtd: make mtd_test.c a separate module 2024-08-19 05:45:05 +02:00
ubi ubi: fastmap: Fix duplicate slab cache names while attaching 2024-12-14 19:51:20 +01:00
ftl.c mtd: fix possible integer overflow in erase_xfer() 2025-08-28 16:24:09 +02:00
inftlcore.c mtd: inftlcore: Add error check for inftl_read_oob() 2025-05-02 07:44:04 +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 mtd: Fix gluebi NULL pointer dereference caused by ftl notifier 2024-01-25 14:52:34 -08:00
mtdblock.c mtdblock: tolerate corrected bit-flips 2023-04-20 12:13:52 +02:00
mtdblock_ro.c mtdblock: Warn if added for a NAND device 2021-08-17 18:41:59 +02:00
mtdchar.c mtd: add OTP (one-time-programmable) erase ioctl 2021-03-28 19:24:54 +02:00
mtdconcat.c mtd: mtdconcat: Check _read, _write callbacks existence before assignment 2021-08-17 18:43:33 +02:00
mtdcore.c mtd: core: Report error if first mtd_otp_size() call fails in mtd_otp_nvmem_add() 2024-06-16 13:39:27 +02:00
mtdcore.h mtd: Provide fs_context-aware mount_mtd() replacement 2019-09-05 14:34:23 -04:00
mtdoops.c mtd: mtdoops: remove unnecessary oom message 2021-06-11 20:43:46 +02:00
mtdpart.c mtd: Fixed breaking list in __mtd_del_partition. 2022-01-27 11:02:48 +01:00
mtdpstore.c mtd: Replace kcalloc() with devm_kcalloc() 2025-05-02 07:44:02 +02:00
mtdsuper.c block: remove i_bdev 2020-12-01 14:53:39 -07:00
mtdswap.c mtd: mtdswap: Use module_mtd_blktrans to register driver 2021-03-11 09:37:48 +01:00
nftlcore.c mtd: nftlcore: remove set but rewrite variables 2021-05-10 12:11:46 +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: sm_ftl: Fix deadlock caused by cancel_work_sync in sm_release 2022-08-17 14:23:40 +02:00
sm_ftl.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ssfdc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00