lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 17 Nov 2016 08:51:23 +0100
From:   Boris Brezillon <boris.brezillon@...e-electrons.com>
To:     Peter Pan <peterpansjtu@...il.com>
Cc:     Richard Weinberger <richard@....at>, linux-mtd@...ts.infradead.org,
        David Woodhouse <dwmw2@...radead.org>,
        Brian Norris <computersforpeace@...il.com>,
        Ezequiel Garcia <ezequiel.garcia@...e-electrons.com>,
        linux-kernel@...r.kernel.org,
        "peterpandong@...ron.com" <peterpandong@...ron.com>
Subject: Re: [PATCH v2 6/7] mtd: nand: raw: make BBT code more generic

On Thu, 17 Nov 2016 14:19:29 +0800
Peter Pan <peterpansjtu@...il.com> wrote:

> Hi Boris,
> 
> On Sun, Oct 16, 2016 at 10:35 PM, Boris Brezillon
> <boris.brezillon@...e-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@...e-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;
> >         }  

Powered by blists - more mailing lists