lkml.org 
[lkml]   [2018]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 13/16] mtd: rawnand: qcom: minor code reorganization for bad block check
Hi Abhishek,

On Mon, 28 May 2018 11:46:47 +0530, Abhishek Sahu
<absahu@codeaurora.org> wrote:

> On 2018-05-26 14:28, Miquel Raynal wrote:
> > Hi Abhishek,
> > > >> @@ -2141,12 +2127,10 @@ static int qcom_nandc_block_bad(struct >> mtd_info *mtd, loff_t ofs)
> >> goto err;
> >> }
> >> >> - bbpos = mtd->writesize - host->cw_size * (ecc->steps - 1);
> >> -
> >> - bad = nandc->data_buffer[bbpos] != 0xff;
> >> + bad = bbm_bytes_buf[0] != 0xff;
> > > BTW, as there are host->bbm_size bytes that can inform on the block
> > state, don't we need to check all of them?
> >
> We are checking all of them.
> host->bbm_size will be either 1 (for NAND_BUSWIDTH_8) or
> 2 (for NAND_BUSWIDTH_16).
>
> https://elixir.bootlin.com/linux/v4.17-rc7/source/drivers/mtd/nand/raw/qcom_nandc.c#L2347
>
> Thanks,
> Abhishek
>
> >> >> if (chip->options & NAND_BUSWIDTH_16)
> >> - bad = bad || (nandc->data_buffer[bbpos + 1] != 0xff);
> >> + bad = bad || (bbm_bytes_buf[1] != 0xff);

As told in my previous reply, I missed the above line.

However, after checking the code of the core (nand_base.c) I wonder if
it is useful to check for the second byte.

And if you look at the core's implementation you'll see that the offset
is not always 0 in the OOB but maybe 5 for small page NAND chips.

Please have a look to the generic implementation and tell me why this
is really needed?

Thanks,
Miquèl

\
 
 \ /
  Last update: 2018-05-28 09:10    [W:0.062 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site