diff mbox series

[v2,3/3] mtd: rawnand: qcom: Fix read len for onfi param page

Message ID 20241122085933.2663927-4-quic_mdalam@quicinc.com
State New
Headers show
Series QPIC v2 fixes for SDX75 | expand

Commit Message

Md Sadre Alam Nov. 22, 2024, 8:59 a.m. UTC
The minimum size to fetch the data from device to QPIC buffer
is 512-bytes. If size is less than 512-bytes the data will not be
protected by ECC as per QPIC standard. So while reading onfi parameter
page from NAND device setting nandc->buf_count = 512.

Cc: stable@vger.kernel.org
Fixes: 89550beb098e ("mtd: rawnand: qcom: Implement exec_op()")
Signed-off-by: Md Sadre Alam <quic_mdalam@quicinc.com>
---

Change in [v2]

* Set buf_count to 512 in the parameter page read

Change in [v1]

* This patch was not included in v1

 drivers/mtd/nand/raw/qcom_nandc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Manivannan Sadhasivam Nov. 26, 2024, 5:45 a.m. UTC | #1
On Fri, Nov 22, 2024 at 02:29:33PM +0530, Md Sadre Alam wrote:
> The minimum size to fetch the data from device to QPIC buffer
> is 512-bytes. If size is less than 512-bytes the data will not be
> protected by ECC as per QPIC standard. So while reading onfi parameter
> page from NAND device setting nandc->buf_count = 512.

s/setting/set

> 
> Cc: stable@vger.kernel.org
> Fixes: 89550beb098e ("mtd: rawnand: qcom: Implement exec_op()")
> Signed-off-by: Md Sadre Alam <quic_mdalam@quicinc.com>

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

- Mani

> ---
> 
> Change in [v2]
> 
> * Set buf_count to 512 in the parameter page read
> 
> Change in [v1]
> 
> * This patch was not included in v1
> 
>  drivers/mtd/nand/raw/qcom_nandc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
> index 31ec3db1246d..e1dca4857754 100644
> --- a/drivers/mtd/nand/raw/qcom_nandc.c
> +++ b/drivers/mtd/nand/raw/qcom_nandc.c
> @@ -2926,7 +2926,7 @@ static int qcom_param_page_type_exec(struct nand_chip *chip,  const struct nand_
>  		write_reg_dma(nandc, NAND_DEV_CMD1, 1, NAND_BAM_NEXT_SGL);
>  	}
>  
> -	nandc->buf_count = len;
> +	nandc->buf_count = 512;
>  	memset(nandc->data_buffer, 0xff, nandc->buf_count);
>  
>  	config_nand_single_cw_page_read(chip, false, 0);
> -- 
> 2.34.1
>
Manivannan Sadhasivam Nov. 26, 2024, 5:49 a.m. UTC | #2
On Tue, Nov 26, 2024 at 11:15:35AM +0530, Manivannan Sadhasivam wrote:
> On Fri, Nov 22, 2024 at 02:29:33PM +0530, Md Sadre Alam wrote:
> > The minimum size to fetch the data from device to QPIC buffer
> > is 512-bytes. If size is less than 512-bytes the data will not be
> > protected by ECC as per QPIC standard. So while reading onfi parameter
> > page from NAND device setting nandc->buf_count = 512.
> 
> s/setting/set
> 
> > 
> > Cc: stable@vger.kernel.org
> > Fixes: 89550beb098e ("mtd: rawnand: qcom: Implement exec_op()")
> > Signed-off-by: Md Sadre Alam <quic_mdalam@quicinc.com>
> 
> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> 

This was a mistake. I didn't intend to give this tag.

- Mani

> - Mani
> 
> > ---
> > 
> > Change in [v2]
> > 
> > * Set buf_count to 512 in the parameter page read
> > 
> > Change in [v1]
> > 
> > * This patch was not included in v1
> > 
> >  drivers/mtd/nand/raw/qcom_nandc.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
> > index 31ec3db1246d..e1dca4857754 100644
> > --- a/drivers/mtd/nand/raw/qcom_nandc.c
> > +++ b/drivers/mtd/nand/raw/qcom_nandc.c
> > @@ -2926,7 +2926,7 @@ static int qcom_param_page_type_exec(struct nand_chip *chip,  const struct nand_
> >  		write_reg_dma(nandc, NAND_DEV_CMD1, 1, NAND_BAM_NEXT_SGL);
> >  	}
> >  
> > -	nandc->buf_count = len;
> > +	nandc->buf_count = 512;
> >  	memset(nandc->data_buffer, 0xff, nandc->buf_count);
> >  
> >  	config_nand_single_cw_page_read(chip, false, 0);
> > -- 
> > 2.34.1
> > 
> 
> -- 
> மணிவண்ணன் சதாசிவம்
diff mbox series

Patch

diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
index 31ec3db1246d..e1dca4857754 100644
--- a/drivers/mtd/nand/raw/qcom_nandc.c
+++ b/drivers/mtd/nand/raw/qcom_nandc.c
@@ -2926,7 +2926,7 @@  static int qcom_param_page_type_exec(struct nand_chip *chip,  const struct nand_
 		write_reg_dma(nandc, NAND_DEV_CMD1, 1, NAND_BAM_NEXT_SGL);
 	}
 
-	nandc->buf_count = len;
+	nandc->buf_count = 512;
 	memset(nandc->data_buffer, 0xff, nandc->buf_count);
 
 	config_nand_single_cw_page_read(chip, false, 0);