mtd: spi-nor: Fix selection of 4-byte addressing opcodes on Spansion
Subsystems (2)
Vignesh Raghavendra
maintainerPATCH 1/1 mtd: spi-nor: Fix selection of 4-byte addressing opcodes on Spansion
mtd->size is still unassigned when running spansion_post_sfdp_fixups() hook, therefore use nor->params.size to determine the size of flash device.
This makes sure that 4-byte addressing opcodes are used on Spansion flashes that are larger than 16MiB and don't have SFDP 4BAIT table populated.
--- drivers/mtd/spi-nor/spi-nor.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mtd/spi-nor/spi-nor.c +1 -3
@@ -4783,9 +4783,7 @@ static void spi_nor_info_init_params(struct spi_nor *nor)static void spansion_post_sfdp_fixups (struct spi_nor *nor) { -struct mtd_info *mtd = &nor->mtd; - -if (mtd->size <=SZ_16M ) +if (nor->params.size <=SZ_16M )return ; nor->flags |=SNOR_F_4B_OPCODES ;
Signature · 1 line
2.24.1
Hi, Vignesh,
Quoted 6 lines · EET Vignesh Raghavendra
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
mtd->sizeis still unassigned when runningspansion_post_sfdp_fixups()hook, therefore usenor->params.sizeto determine the size of flash device.
Quoted 6 lines
This makes sure that 4-byte addressing opcodes are used on Spansion flashes that are larger than 16MiB and don't have SFDP 4BAIT table populated.
Fixes 92094ebc385e ("mtd: spi-nor: Add spansion_post_sfdp_fixups()")Signed-off-by Vignesh Raghavendra <[email protected]>
This fixes a recent bug, so if you want to take it through mtd/fixes you can add:
If you want this through spi-nor/next, please let me know and I'll queue it.
Cheers,
ta
Quoted 22 lines
--- drivers/mtd/spi-nor/spi-nor.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/mtd/spi-nor/spi-nor.c +1
-3@@ -4783,9 +4783,7 @@ static void spi_nor_info_init_params(struct spi_nor *nor)static void spansion_post_sfdp_fixups (struct spi_nor *nor) { -struct mtd_info *mtd = &nor->mtd; - -if (mtd->size <=SZ_16M ) +if (nor->params.size <=SZ_16M )return ;nor->flags |= SNOR_F_4B_OPCODES;--
2.24.1
Miquel,
Please queue this to mtd/fixes.
Thanks,
ta
Quoted 34 lines · EET Vignesh Raghavendra
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
mtd->sizeis still unassigned when runningspansion_post_sfdp_fixups()hook, therefore usenor->params.sizeto determine the size of flash device.This makes sure that 4-byte addressing opcodes are used on Spansion flashes that are larger than 16MiB and don't have SFDP 4BAIT table populated.
Fixes 92094ebc385e ("mtd: spi-nor: Add spansion_post_sfdp_fixups()")Signed-off-by Vignesh Raghavendra <[email protected]>--- drivers/mtd/spi-nor/spi-nor.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/mtd/spi-nor/spi-nor.c +1
-3@@ -4783,9 +4783,7 @@ static void spi_nor_info_init_params(struct spi_nor *nor)static void spansion_post_sfdp_fixups (struct spi_nor *nor) { -struct mtd_info *mtd = &nor->mtd; - -if (mtd->size <=SZ_16M ) +if (nor->params.size <=SZ_16M )return ;nor->flags |= SNOR_F_4B_OPCODES;--
2.24.1
Quoted 10 lines · Vignesh Raghavendra
mtd->sizeis still unassigned when runningspansion_post_sfdp_fixups()hook, therefore usenor->params.sizeto determine the size of flash device.This makes sure that 4-byte addressing opcodes are used on Spansion flashes that are larger than 16MiB and don't have SFDP 4BAIT table populated.
Fixes 92094ebc385e ("mtd: spi-nor: Add spansion_post_sfdp_fixups()")Signed-off-by Vignesh Raghavendra <[email protected]>Reviewed-by Tudor Ambarus <[email protected]>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/fixes, thanks.
Miquel