From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Sergey Larin <cerg2010cerg2010@mail.ru>
Cc: miquel.raynal@bootlin.com, richard@nod.at, dwmw2@infradead.org,
computersforpeace@gmail.com, marek.vasut@gmail.com,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] mtd: rawnand: docg4: specify bits_per_cell
Date: Sun, 8 Jul 2018 14:04:49 +0200 [thread overview]
Message-ID: <20180708140449.31efdc59@bbrezillon> (raw)
In-Reply-To: <48cec9b431a42375cd9033b225f3573002574f17.1531045014.git.cerg2010cerg2010@mail.ru>
On Sun, 8 Jul 2018 14:29:24 +0300
Sergey Larin <cerg2010cerg2010@mail.ru> wrote:
> This fixes WARN() in nand_is_slc().
>
> DoC G4 is 2-bit MLC, so set bits_per_cell value according to this.
What you do here implies "no UBI on docg4". To be honest, I'm pretty
sure there's an FTL in there, which clearly does not make it a good
candidate for the raw NAND framework. Not to mention that it's not even
using the same instruction set which forced developers of this driver
to guess what the core was trying to do in the ->cmdfunc()
implementation and convert it to docg4 operations. This approach is
going against the recent evolution of the raw NAND framework
(deprecating ->cmdfunc() in favor of ->exec_op()).
I'd really like to see this driver moved outside of
drivers/mtd/nand/raw/. If it really has NAND constraints, you could
re-use the interface agnostic NAND framework (include/linux/nand.h) and
add a new driver under drivers/mtd/nand/diskonchip/docg4.c.
That's the very reason I asked if you if you had access to this HW. I
can help you with the development part, but I can't test.
>
> Signed-off-by: Sergey Larin <cerg2010cerg2010@mail.ru>
> ---
> drivers/mtd/nand/raw/docg4.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mtd/nand/raw/docg4.c b/drivers/mtd/nand/raw/docg4.c
> index bbed8ea7858c..82d97a16e246 100644
> --- a/drivers/mtd/nand/raw/docg4.c
> +++ b/drivers/mtd/nand/raw/docg4.c
> @@ -1250,6 +1250,7 @@ static void __init init_mtd_structs(struct mtd_info *mtd)
> nand->pagemask = 0x3ffff;
> nand->badblockpos = NAND_LARGE_BADBLOCK_POS;
> nand->badblockbits = 8;
> + nand->bits_per_cell = 2;
> nand->ecc.mode = NAND_ECC_HW_SYNDROME;
> nand->ecc.size = DOCG4_PAGE_SIZE;
> nand->ecc.prepad = 8;
next prev parent reply other threads:[~2018-07-08 12:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-08 11:29 [PATCH 0/2] fix regressions in DoC G4 driver Sergey Larin
2018-07-08 11:29 ` [PATCH 1/2] mtd: rawnand: docg4: fix NULL deref while probing Sergey Larin
2018-07-08 11:44 ` Miquel Raynal
2018-07-08 11:53 ` Boris Brezillon
2018-07-08 14:24 ` kbuild test robot
2018-07-08 11:29 ` [PATCH 2/2] mtd: rawnand: docg4: specify bits_per_cell Sergey Larin
2018-07-08 12:04 ` Boris Brezillon [this message]
2018-07-08 11:41 ` [PATCH 0/2] fix regressions in DoC G4 driver Boris Brezillon
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=20180708140449.31efdc59@bbrezillon \
--to=boris.brezillon@bootlin.com \
--cc=cerg2010cerg2010@mail.ru \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=miquel.raynal@bootlin.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).