[PATCH v4 1/8] mtd: spi-nor: Introduce the concept of bank

Tudor Ambarus tudor.ambarus at linaro.org
Thu Mar 16 20:36:54 PDT 2023



On 2/1/23 11:35, Miquel Raynal wrote:
> diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
> index b500655f7937..3845de9c874c 100644
> --- a/drivers/mtd/spi-nor/core.c
> +++ b/drivers/mtd/spi-nor/core.c
> @@ -2574,7 +2574,8 @@ static void spi_nor_init_default_params(struct spi_nor *nor)
>  
>  	/* Set SPI NOR sizes. */
>  	params->writesize = 1;
> -	params->size = (u64)info->sector_size * info->n_sectors;
> +	params->bank_size = (u64)info->sector_size * info->n_sectors;
> +	params->size = params->bank_size * info->n_banks;

Please keep the n_sectors per flash, not per bank, you'll break the
block protection support for these flashes. See the email thread on your
v3 2/9.



More information about the linux-arm-kernel mailing list