[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181210123809.5ade45c4@bbrezillon>
Date: Mon, 10 Dec 2018 12:38:09 +0100
From: Boris Brezillon <boris.brezillon@...tlin.com>
To: Liang Yang <liang.yang@...ogic.com>
Cc: Miquel Raynal <miquel.raynal@...tlin.com>,
Jianxin Pan <jianxin.pan@...ogic.com>,
<linux-mtd@...ts.infradead.org>, Yixun Lan <yixun.lan@...ogic.com>,
David Woodhouse <dwmw2@...radead.org>,
Brian Norris <computersforpeace@...il.com>,
Marek Vasut <marek.vasut@...il.com>,
Richard Weinberger <richard@....at>,
Jerome Brunet <jbrunet@...libre.com>,
Neil Armstrong <narmstrong@...libre.com>,
Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
Carlo Caione <carlo@...one.org>,
Kevin Hilman <khilman@...libre.com>,
Rob Herring <robh@...nel.org>, Jian Hu <jian.hu@...ogic.com>,
Hanjie Lin <hanjie.lin@...ogic.com>,
Victor Wan <victor.wan@...ogic.com>,
<linux-amlogic@...ts.infradead.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v7 2/2] mtd: rawnand: meson: add support for Amlogic
NAND flash controller
On Mon, 10 Dec 2018 19:23:46 +0800
Liang Yang <liang.yang@...ogic.com> wrote:
> >> + mtd->ecc_stats.failed++;
> >> + continue;
> >> + }
> >> + mtd->ecc_stats.corrected += ECC_ERR_CNT(*info);
> >> + bitflips = max_t(u32, bitflips, ECC_ERR_CNT(*info));
> >> + }
> >
> > Are you sure you handle correctly empty pages with bf?
> >
> if scramble is enable, i would say yes here.
> when scramble is disabled, i am considering how to use the helper
> nand_check_erased_ecc_chunk, but it seems that i can't get the ecc
> bytes which is caculated by ecc engine.by the way, nfc dma doesn't send
> out the ecc parity bytes.
Even if the ECC engine is disabled?
> so i would suggest using scramble.
>
No, please don't force people to use the scrambler.
> >> +
> >> +const void *
> >> +meson_nand_op_get_dma_safe_output_buf(const struct nand_op_instr *instr)
> >> +{
> >> + if (WARN_ON(instr->type != NAND_OP_DATA_OUT_INSTR))
> >> + return NULL;
> >> +
> >> + if (virt_addr_valid(instr->ctx.data.buf.out) &&
> >> + !object_is_on_stack(instr->ctx.data.buf.out))
> >
> > Can you please create helpers for that? I guess it will help removing
> > these checks once the core will have a DMA-safe approach.
> >
> I will use below definition:
> #define BUFFER_IS_DMA_SAFE(x) \
> (virt_addr_valid((x)) && (!object_is_on_stack((x))))
>
> Is it ok?
Please define a function, not a macro.
Powered by blists - more mailing lists