Linux-mtd Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] mtd: spi-nor: Fix selection of 4-byte addressing opcodes on Spansion
@ 2020-01-08  5:13 Vignesh Raghavendra
  2020-01-13 10:17 ` Tudor.Ambarus
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Vignesh Raghavendra @ 2020-01-08  5:13 UTC (permalink / raw)
  To: Tudor Ambarus
  Cc: Richard Weinberger, linux-mtd, Vignesh Raghavendra, linux-kernel,
	Miquel Raynal

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.

Fixes: 92094ebc385e ("mtd: spi-nor: Add spansion_post_sfdp_fixups()")
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
---
 drivers/mtd/spi-nor/spi-nor.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
index 1082b6bb1393..cd47f07deff3 100644
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -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


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: spi-nor: Fix selection of 4-byte addressing opcodes on Spansion
  2020-01-08  5:13 [PATCH] mtd: spi-nor: Fix selection of 4-byte addressing opcodes on Spansion Vignesh Raghavendra
@ 2020-01-13 10:17 ` Tudor.Ambarus
  2020-01-17 13:57 ` Tudor.Ambarus
  2020-01-17 21:47 ` Miquel Raynal
  2 siblings, 0 replies; 4+ messages in thread
From: Tudor.Ambarus @ 2020-01-13 10:17 UTC (permalink / raw)
  To: vigneshr; +Cc: richard, linux-mtd, linux-kernel, miquel.raynal

Hi, Vignesh,

On Wednesday, January 8, 2020 7:13:43 AM EET Vignesh Raghavendra wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> content is safe
> 
> 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.
> 
> Fixes: 92094ebc385e ("mtd: spi-nor: Add spansion_post_sfdp_fixups()")
> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>

This fixes a recent bug, so if you want to take it through mtd/fixes you can 
add:

Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>

If you want this through spi-nor/next, please let me know and I'll queue it.

Cheers,
ta

> ---
>  drivers/mtd/spi-nor/spi-nor.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
> index 1082b6bb1393..cd47f07deff3 100644
> --- a/drivers/mtd/spi-nor/spi-nor.c
> +++ b/drivers/mtd/spi-nor/spi-nor.c
> @@ -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




______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: spi-nor: Fix selection of 4-byte addressing opcodes on Spansion
  2020-01-08  5:13 [PATCH] mtd: spi-nor: Fix selection of 4-byte addressing opcodes on Spansion Vignesh Raghavendra
  2020-01-13 10:17 ` Tudor.Ambarus
@ 2020-01-17 13:57 ` Tudor.Ambarus
  2020-01-17 21:47 ` Miquel Raynal
  2 siblings, 0 replies; 4+ messages in thread
From: Tudor.Ambarus @ 2020-01-17 13:57 UTC (permalink / raw)
  To: vigneshr, miquel.raynal; +Cc: richard, linux-mtd, linux-kernel

Miquel,

Please queue this to mtd/fixes.

Thanks,
ta

On Wednesday, January 8, 2020 7:13:43 AM EET Vignesh Raghavendra wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> content is safe
> 
> 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.
> 
> Fixes: 92094ebc385e ("mtd: spi-nor: Add spansion_post_sfdp_fixups()")
> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
> ---
>  drivers/mtd/spi-nor/spi-nor.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
> index 1082b6bb1393..cd47f07deff3 100644
> --- a/drivers/mtd/spi-nor/spi-nor.c
> +++ b/drivers/mtd/spi-nor/spi-nor.c
> @@ -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




______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: spi-nor: Fix selection of 4-byte addressing opcodes on Spansion
  2020-01-08  5:13 [PATCH] mtd: spi-nor: Fix selection of 4-byte addressing opcodes on Spansion Vignesh Raghavendra
  2020-01-13 10:17 ` Tudor.Ambarus
  2020-01-17 13:57 ` Tudor.Ambarus
@ 2020-01-17 21:47 ` Miquel Raynal
  2 siblings, 0 replies; 4+ messages in thread
From: Miquel Raynal @ 2020-01-17 21:47 UTC (permalink / raw)
  To: Vignesh Raghavendra, Tudor Ambarus
  Cc: Richard Weinberger, linux-mtd, linux-kernel, Miquel Raynal

On Wed, 2020-01-08 at 05:13:43 UTC, Vignesh Raghavendra wrote:
> 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.
> 
> Fixes: 92094ebc385e ("mtd: spi-nor: Add spansion_post_sfdp_fixups()")
> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
> Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/fixes, thanks.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-08  5:13 [PATCH] mtd: spi-nor: Fix selection of 4-byte addressing opcodes on Spansion Vignesh Raghavendra
2020-01-13 10:17 ` Tudor.Ambarus
2020-01-17 13:57 ` Tudor.Ambarus
2020-01-17 21:47 ` Miquel Raynal

Linux-mtd Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mtd/0 linux-mtd/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mtd linux-mtd/ https://lore.kernel.org/linux-mtd \
		linux-mtd@lists.infradead.org
	public-inbox-index linux-mtd

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-mtd


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git