[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180708140449.31efdc59@bbrezillon>
Date: Sun, 8 Jul 2018 14:04:49 +0200
From: Boris Brezillon <boris.brezillon@...tlin.com>
To: Sergey Larin <cerg2010cerg2010@...l.ru>
Cc: miquel.raynal@...tlin.com, richard@....at, dwmw2@...radead.org,
computersforpeace@...il.com, marek.vasut@...il.com,
linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] mtd: rawnand: docg4: specify bits_per_cell
On Sun, 8 Jul 2018 14:29:24 +0300
Sergey Larin <cerg2010cerg2010@...l.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@...l.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;
Powered by blists - more mailing lists