Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1524113 > unrolled thread

Re: [PATCH v2 6/7] mtd: nand: raw: make BBT code more generic

Started byPeter Pan <peterpansjtu@gmail.com>
First post2016-11-17 07:20 +0100
Last post2016-11-17 09:00 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v2 6/7] mtd: nand: raw: make BBT code more generic Peter Pan <peterpansjtu@gmail.com> - 2016-11-17 07:20 +0100
    Re: [PATCH v2 6/7] mtd: nand: raw: make BBT code more generic Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-11-17 09:00 +0100

#1524113 — Re: [PATCH v2 6/7] mtd: nand: raw: make BBT code more generic

FromPeter Pan <peterpansjtu@gmail.com>
Date2016-11-17 07:20 +0100
SubjectRe: [PATCH v2 6/7] mtd: nand: raw: make BBT code more generic
Message-ID<sEodb-5pp-1@gated-at.bofh.it>
Hi Boris,

On Sun, Oct 16, 2016 at 10:35 PM, Boris Brezillon
<boris.brezillon@free-electrons.com> wrote:
> BBT support is currently tightly tied to raw NAND, though this is the kind
> of code we could share across all NAND based devices, no matter what
> physical interface is to communicate with the NAND chip.
>
> Make BBT code interface agnostic by replacing all occurrence of
> struct nand_chip by struct nand_device, and move functions that are
> specific to raw NANDs to drivers/mtd/nand/rawnand/nand_base.c.
>
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> ---
>  drivers/mtd/nand/raw/nand_base.c |  78 ++++-
>  drivers/mtd/nand/raw/nand_bbt.c  | 609 ++++++++++++++++++---------------------
>  include/linux/mtd/nand.h         |   8 +
>  include/linux/mtd/rawnand.h      |   4 -
>  4 files changed, 361 insertions(+), 338 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
> index b86f4a1bfbe1..4930b3569de9 100644
> --- a/drivers/mtd/nand/raw/nand_base.c
> +++ b/drivers/mtd/nand/raw/nand_base.c
> @@ -471,7 +471,7 @@ static int nand_block_markbad_lowlevel(struct mtd_info *mtd, loff_t ofs)
>
>         /* Mark block bad in BBT */
>         if (chip->bbt) {

Should be "if (!nand->bbt.bbt)".

> -               res = nand_markbad_bbt(mtd, ofs);
> +               res = nand_markbad_bbt(mtd_to_nand(mtd), ofs);
>                 if (!ret)
>                         ret = res;
>         }

[toc] | [next] | [standalone]


#1524147

FromBoris Brezillon <boris.brezillon@free-electrons.com>
Date2016-11-17 09:00 +0100
Message-ID<sEpLX-69J-5@gated-at.bofh.it>
In reply to#1524113
On Thu, 17 Nov 2016 14:19:29 +0800
Peter Pan <peterpansjtu@gmail.com> wrote:

> Hi Boris,
> 
> On Sun, Oct 16, 2016 at 10:35 PM, Boris Brezillon
> <boris.brezillon@free-electrons.com> wrote:
> > BBT support is currently tightly tied to raw NAND, though this is the kind
> > of code we could share across all NAND based devices, no matter what
> > physical interface is to communicate with the NAND chip.
> >
> > Make BBT code interface agnostic by replacing all occurrence of
> > struct nand_chip by struct nand_device, and move functions that are
> > specific to raw NANDs to drivers/mtd/nand/rawnand/nand_base.c.
> >
> > Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> > ---
> >  drivers/mtd/nand/raw/nand_base.c |  78 ++++-
> >  drivers/mtd/nand/raw/nand_bbt.c  | 609 ++++++++++++++++++---------------------
> >  include/linux/mtd/nand.h         |   8 +
> >  include/linux/mtd/rawnand.h      |   4 -
> >  4 files changed, 361 insertions(+), 338 deletions(-)
> >
> > diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
> > index b86f4a1bfbe1..4930b3569de9 100644
> > --- a/drivers/mtd/nand/raw/nand_base.c
> > +++ b/drivers/mtd/nand/raw/nand_base.c
> > @@ -471,7 +471,7 @@ static int nand_block_markbad_lowlevel(struct mtd_info *mtd, loff_t ofs)
> >
> >         /* Mark block bad in BBT */
> >         if (chip->bbt) {  
> 
> Should be "if (!nand->bbt.bbt)".

Indeed. And this makes me realize this chip->bbt field should be gone
(which is not the case since I had no compilation error).

> 
> > -               res = nand_markbad_bbt(mtd, ofs);
> > +               res = nand_markbad_bbt(mtd_to_nand(mtd), ofs);
> >                 if (!ret)
> >                         ret = res;
> >         }  

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web