All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: parsers: qcom: incompatible with spi-nor 4k sectors
@ 2021-03-03 14:12 ` Baruch Siach
  0 siblings, 0 replies; 6+ messages in thread
From: Baruch Siach @ 2021-03-03 14:12 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra
  Cc: linux-mtd, linux-arm-msm, Manivannan Sadhasivam, Baruch Siach

Partition size and offset value are in block size units, which is the
same as 'erasesize'. But when 4K sectors are enabled erasesize is set to
4K. Bail out in that case.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 drivers/mtd/parsers/qcomsmempart.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/mtd/parsers/qcomsmempart.c b/drivers/mtd/parsers/qcomsmempart.c
index 808cb33d71f8..f851574e1b52 100644
--- a/drivers/mtd/parsers/qcomsmempart.c
+++ b/drivers/mtd/parsers/qcomsmempart.c
@@ -65,6 +65,13 @@ static int parse_qcomsmem_part(struct mtd_info *mtd,
 	int ret, i, numparts;
 	char *name, *c;
 
+	if (IS_ENABLED(CONFIG_MTD_SPI_NOR_USE_4K_SECTORS)
+			&& mtd->type == MTD_NORFLASH) {
+		pr_err("%s: SMEM partition parse is incompatible with 4K sectors\n",
+				mtd->name);
+		return -EINVAL;
+	}
+
 	pr_debug("Parsing partition table info from SMEM\n");
 	ptable = qcom_smem_get(SMEM_APPS, SMEM_AARM_PARTITION_TABLE, &len);
 	if (IS_ERR(ptable)) {
-- 
2.30.1


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

* [PATCH] mtd: parsers: qcom: incompatible with spi-nor 4k sectors
@ 2021-03-03 14:12 ` Baruch Siach
  0 siblings, 0 replies; 6+ messages in thread
From: Baruch Siach @ 2021-03-03 14:12 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra
  Cc: linux-mtd, linux-arm-msm, Manivannan Sadhasivam, Baruch Siach

Partition size and offset value are in block size units, which is the
same as 'erasesize'. But when 4K sectors are enabled erasesize is set to
4K. Bail out in that case.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 drivers/mtd/parsers/qcomsmempart.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/mtd/parsers/qcomsmempart.c b/drivers/mtd/parsers/qcomsmempart.c
index 808cb33d71f8..f851574e1b52 100644
--- a/drivers/mtd/parsers/qcomsmempart.c
+++ b/drivers/mtd/parsers/qcomsmempart.c
@@ -65,6 +65,13 @@ static int parse_qcomsmem_part(struct mtd_info *mtd,
 	int ret, i, numparts;
 	char *name, *c;
 
+	if (IS_ENABLED(CONFIG_MTD_SPI_NOR_USE_4K_SECTORS)
+			&& mtd->type == MTD_NORFLASH) {
+		pr_err("%s: SMEM partition parse is incompatible with 4K sectors\n",
+				mtd->name);
+		return -EINVAL;
+	}
+
 	pr_debug("Parsing partition table info from SMEM\n");
 	ptable = qcom_smem_get(SMEM_APPS, SMEM_AARM_PARTITION_TABLE, &len);
 	if (IS_ERR(ptable)) {
-- 
2.30.1


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

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

* Re: [PATCH] mtd: parsers: qcom: incompatible with spi-nor 4k sectors
  2021-03-03 14:12 ` Baruch Siach
@ 2021-03-03 14:19   ` Miquel Raynal
  -1 siblings, 0 replies; 6+ messages in thread
From: Miquel Raynal @ 2021-03-03 14:19 UTC (permalink / raw)
  To: Baruch Siach
  Cc: Richard Weinberger, Vignesh Raghavendra, linux-mtd,
	linux-arm-msm, Manivannan Sadhasivam

Hi Baruch,

Baruch Siach <baruch@tkos.co.il> wrote on Wed,  3 Mar 2021 16:12:12
+0200:

> Partition size and offset value are in block size units, which is the
> same as 'erasesize'. But when 4K sectors are enabled erasesize is set to
> 4K. Bail out in that case.
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>

Could you add a Fixes tag?

LGTM otherwise.

Thanks,
Miquèl

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

* Re: [PATCH] mtd: parsers: qcom: incompatible with spi-nor 4k sectors
@ 2021-03-03 14:19   ` Miquel Raynal
  0 siblings, 0 replies; 6+ messages in thread
From: Miquel Raynal @ 2021-03-03 14:19 UTC (permalink / raw)
  To: Baruch Siach
  Cc: Richard Weinberger, Vignesh Raghavendra, linux-mtd,
	linux-arm-msm, Manivannan Sadhasivam

Hi Baruch,

Baruch Siach <baruch@tkos.co.il> wrote on Wed,  3 Mar 2021 16:12:12
+0200:

> Partition size and offset value are in block size units, which is the
> same as 'erasesize'. But when 4K sectors are enabled erasesize is set to
> 4K. Bail out in that case.
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>

Could you add a Fixes tag?

LGTM otherwise.

Thanks,
Miquèl

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

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

* Re: [PATCH] mtd: parsers: qcom: incompatible with spi-nor 4k sectors
  2021-03-03 14:12 ` Baruch Siach
@ 2021-03-03 16:24   ` Manivannan Sadhasivam
  -1 siblings, 0 replies; 6+ messages in thread
From: Manivannan Sadhasivam @ 2021-03-03 16:24 UTC (permalink / raw)
  To: Baruch Siach
  Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	linux-mtd, linux-arm-msm

On Wed, Mar 03, 2021 at 04:12:12PM +0200, Baruch Siach wrote:
> Partition size and offset value are in block size units, which is the
> same as 'erasesize'. But when 4K sectors are enabled erasesize is set to
> 4K. Bail out in that case.
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
>  drivers/mtd/parsers/qcomsmempart.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/mtd/parsers/qcomsmempart.c b/drivers/mtd/parsers/qcomsmempart.c
> index 808cb33d71f8..f851574e1b52 100644
> --- a/drivers/mtd/parsers/qcomsmempart.c
> +++ b/drivers/mtd/parsers/qcomsmempart.c
> @@ -65,6 +65,13 @@ static int parse_qcomsmem_part(struct mtd_info *mtd,
>  	int ret, i, numparts;
>  	char *name, *c;
>  
> +	if (IS_ENABLED(CONFIG_MTD_SPI_NOR_USE_4K_SECTORS)
> +			&& mtd->type == MTD_NORFLASH) {
> +		pr_err("%s: SMEM partition parse is incompatible with 4K sectors\n",

s/parse/parser

With that and the fixes tag,

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Thanks,
Mani

> +				mtd->name);
> +		return -EINVAL;
> +	}
> +
>  	pr_debug("Parsing partition table info from SMEM\n");
>  	ptable = qcom_smem_get(SMEM_APPS, SMEM_AARM_PARTITION_TABLE, &len);
>  	if (IS_ERR(ptable)) {
> -- 
> 2.30.1
> 

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

* Re: [PATCH] mtd: parsers: qcom: incompatible with spi-nor 4k sectors
@ 2021-03-03 16:24   ` Manivannan Sadhasivam
  0 siblings, 0 replies; 6+ messages in thread
From: Manivannan Sadhasivam @ 2021-03-03 16:24 UTC (permalink / raw)
  To: Baruch Siach
  Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	linux-mtd, linux-arm-msm

On Wed, Mar 03, 2021 at 04:12:12PM +0200, Baruch Siach wrote:
> Partition size and offset value are in block size units, which is the
> same as 'erasesize'. But when 4K sectors are enabled erasesize is set to
> 4K. Bail out in that case.
> 
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
>  drivers/mtd/parsers/qcomsmempart.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/mtd/parsers/qcomsmempart.c b/drivers/mtd/parsers/qcomsmempart.c
> index 808cb33d71f8..f851574e1b52 100644
> --- a/drivers/mtd/parsers/qcomsmempart.c
> +++ b/drivers/mtd/parsers/qcomsmempart.c
> @@ -65,6 +65,13 @@ static int parse_qcomsmem_part(struct mtd_info *mtd,
>  	int ret, i, numparts;
>  	char *name, *c;
>  
> +	if (IS_ENABLED(CONFIG_MTD_SPI_NOR_USE_4K_SECTORS)
> +			&& mtd->type == MTD_NORFLASH) {
> +		pr_err("%s: SMEM partition parse is incompatible with 4K sectors\n",

s/parse/parser

With that and the fixes tag,

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Thanks,
Mani

> +				mtd->name);
> +		return -EINVAL;
> +	}
> +
>  	pr_debug("Parsing partition table info from SMEM\n");
>  	ptable = qcom_smem_get(SMEM_APPS, SMEM_AARM_PARTITION_TABLE, &len);
>  	if (IS_ERR(ptable)) {
> -- 
> 2.30.1
> 

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

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

end of thread, other threads:[~2021-03-03 23:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-03 14:12 [PATCH] mtd: parsers: qcom: incompatible with spi-nor 4k sectors Baruch Siach
2021-03-03 14:12 ` Baruch Siach
2021-03-03 14:19 ` Miquel Raynal
2021-03-03 14:19   ` Miquel Raynal
2021-03-03 16:24 ` Manivannan Sadhasivam
2021-03-03 16:24   ` Manivannan Sadhasivam

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.