From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Peter Pan <peterpansjtu@gmail.com>
Cc: Richard Weinberger <richard@nod.at>,
linux-mtd@lists.infradead.org,
David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Ezequiel Garcia <ezequiel.garcia@free-electrons.com>,
linux-kernel@vger.kernel.org,
"peterpandong@micron.com" <peterpandong@micron.com>
Subject: Re: [PATCH v2 6/7] mtd: nand: raw: make BBT code more generic
Date: Thu, 17 Nov 2016 08:51:23 +0100 [thread overview]
Message-ID: <20161117085123.3d850e81@bbrezillon> (raw)
In-Reply-To: <CAAyFORJR5xUCxp=jQ2kzxp7H3ArLijWAPafOgFWP19Vj97naRw@mail.gmail.com>
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;
> > }
next prev parent reply other threads:[~2016-11-17 7:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-16 14:35 [PATCH v2 0/7] mtd: nand: Abstract away the NAND interface type Boris Brezillon
2016-10-16 14:35 ` [PATCH v2 1/7] mtd: nand: Rename nand.h into rawnand.h Boris Brezillon
2016-10-16 14:35 ` [PATCH v2 2/7] mtd: nand: move raw NAND related code to the raw/ subdir Boris Brezillon
2016-10-16 14:35 ` [PATCH v2 3/7] mtd: nand: add a nand.h file to expose basic NAND stuff Boris Brezillon
2016-11-17 6:14 ` Peter Pan
2016-11-17 7:52 ` Boris Brezillon
2016-10-16 14:35 ` [PATCH v2 4/7] mtd: nand: raw: prefix conflicting names with nandc instead of nand Boris Brezillon
2016-10-16 14:35 ` [PATCH v2 5/7] mtd: nand: raw: create struct rawnand_device Boris Brezillon
2016-10-16 14:35 ` [PATCH v2 6/7] mtd: nand: raw: make BBT code more generic Boris Brezillon
2016-11-16 8:43 ` Peter Pan
2016-11-16 8:46 ` Boris Brezillon
2016-11-17 6:19 ` Peter Pan
2016-11-17 7:51 ` Boris Brezillon [this message]
2016-10-16 14:35 ` [PATCH v2 7/7] mtd: nand: move BBT code to drivers/mtd/nand/ Boris Brezillon
2016-11-17 6:26 ` [PATCH v2 0/7] mtd: nand: Abstract away the NAND interface type Peter Pan
2016-11-17 7:56 ` Boris Brezillon
2016-11-17 8:08 ` Peter Pan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161117085123.3d850e81@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=ezequiel.garcia@free-electrons.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=peterpandong@micron.com \
--cc=peterpansjtu@gmail.com \
--cc=richard@nod.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.