kernel_samsung_a53x/drivers/mtd/nand/raw
Miquel Raynal 339dd2c40b mtd: rawnand: Bypass a couple of sanity checks during NAND identification
commit 8754d9835683e8fab9a8305acdb38a3aeb9d20bd upstream.

Early during NAND identification, mtd_info fields have not yet been
initialized (namely, writesize and oobsize) and thus cannot be used for
sanity checks yet. Of course if there is a misuse of
nand_change_read_column_op() so early we won't be warned, but there is
anyway no actual check to perform at this stage as we do not yet know
the NAND geometry.

So, if the fields are empty, especially mtd->writesize which is *always*
set quite rapidly after identification, let's skip the sanity checks.

nand_change_read_column_op() is subject to be used early for ONFI/JEDEC
identification in the very unlikely case of:
- bitflips appearing in the parameter page,
- the controller driver not supporting simple DATA_IN cycles.

As nand_change_read_column_op() uses nand_fill_column_cycles() the logic
explaind above also applies in this secondary helper.

Fixes: c27842e7e11f ("mtd: rawnand: onfi: Adapt the parameter page read to constraint controllers")
Fixes: daca31765e8b ("mtd: rawnand: jedec: Adapt the parameter page read to constraint controllers")
Cc: stable@vger.kernel.org
Reported-by: Alexander Dahl <ada@thorsis.com>
Closes: https://lore.kernel.org/linux-mtd/20240306-shaky-bunion-d28b65ea97d7@thorsis.com/
Reported-by: Steven Seeger <steven.seeger@flightsystems.net>
Closes: https://lore.kernel.org/linux-mtd/DM6PR05MB4506554457CF95191A670BDEF7062@DM6PR05MB4506.namprd05.prod.outlook.com/
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.kernel.org/linux-mtd/20240516131320.579822-3-miquel.raynal@bootlin.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-19 14:19:42 +01:00
..
atmel Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bcm47xxnflash Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
brcmnand Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
gpmi-nand Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ingenic Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ams-delta.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
arasan-nand-controller.c mtd: rawnand: arasan: Ensure program page operations are successful 2024-11-08 11:26:18 +01:00
au1550nd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cadence-nand-controller.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cafe_nand.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cs553x_nand.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
davinci_nand.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
denali.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
denali.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
denali_dt.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
denali_pci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
diskonchip.c mtd: diskonchip: work around ubsan link failure 2024-11-19 11:32:40 +01:00
fsl_elbc_nand.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fsl_ifc_nand.c mtd: rawnand: Increment IFC_TIMEOUT_MSECS for nand controller response 2024-11-18 12:12:20 +01:00
fsl_upm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fsmc_nand.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
gpio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hisi504_nand.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
internals.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lpc32xx_mlc.c mtd: rawnand: lpc32xx_mlc: fix irq handler prototype 2024-11-19 08:44:54 +01:00
lpc32xx_slc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
marvell_nand.c mtd: rawnand: marvell: Ensure program page operations are successful 2024-11-08 11:26:18 +01:00
meson_nand.c mtd: rawnand: meson: fix scrambling mode value in command macro 2024-11-19 09:22:16 +01:00
mpc5121_nfc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mtk_ecc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mtk_ecc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mtk_nand.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mxc_nand.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mxic_nand.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nand_amd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nand_base.c mtd: rawnand: Bypass a couple of sanity checks during NAND identification 2024-11-19 14:19:42 +01:00
nand_bbt.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nand_bch.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nand_ecc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nand_esmt.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nand_hynix.c mtd: rawnand: hynix: fixed typo 2024-11-19 12:26:57 +01:00
nand_ids.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nand_jedec.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nand_legacy.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nand_macronix.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nand_micron.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nand_onfi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nand_samsung.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nand_timings.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nand_toshiba.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nandsim.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ndfc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
omap2.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
omap_elm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
orion_nand.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
oxnas_nand.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pasemi_nand.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
plat_nand.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
qcom_nandc.c mtd: rawnand: qcom: Unmap the right resource upon probe failure 2024-11-08 11:26:18 +01:00
r852.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r852.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
s3c2410.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sh_flctl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sharpsl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sm_common.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sm_common.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
socrates_nand.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stm32_fmc2_nand.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sunxi_nand.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tango_nand.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tegra_nand.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tmio_nand.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
txx9ndfmc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vf610_nfc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xway_nand.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00