From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 11 Dec 2018 08:54:45 +0100 From: Miquel Raynal To: Liang Yang Cc: Boris Brezillon , Jianxin Pan , , Yixun Lan , David Woodhouse , Brian Norris , Marek Vasut , Richard Weinberger , Jerome Brunet , Neil Armstrong , Martin Blumenstingl , Carlo Caione , Kevin Hilman , Rob Herring , Jian Hu , Hanjie Lin , Victor Wan , , , Subject: Re: [PATCH v7 2/2] mtd: rawnand: meson: add support for Amlogic NAND flash controller Message-ID: <20181211085445.68e57e0e@xps13> In-Reply-To: References: <1542386439-30166-1-git-send-email-jianxin.pan@amlogic.com> <1542386439-30166-3-git-send-email-jianxin.pan@amlogic.com> <20181207102456.1dc67e07@xps13> <823825a3-86fb-9a20-ae29-85cc52d44093@amlogic.com> <20181210123809.5ade45c4@bbrezillon> <79a797c2-f37f-7f7c-e907-2d3c2283ec2d@amlogic.com> <20181210155057.38788656@xps13> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Hi Liang, Liang Yang wrote on Tue, 11 Dec 2018 09:56:25 +0800: > Hi Miquel, >=20 > On 2018/12/10 22:50, Miquel Raynal wrote: > > Hi Liang, > >=20 > > Liang Yang wrote on Mon, 10 Dec 2018 20:12:39 > > +0800: > > =20 > >> On 2018/12/10 19:38, Boris Brezillon wrote: =20 > >>> On Mon, 10 Dec 2018 19:23:46 +0800 > >>> Liang Yang wrote: =20 > >>> >>>>>> + mtd->ecc_stats.failed++; =20 > >>>>>> + continue; > >>>>>> + } > >>>>>> + mtd->ecc_stats.corrected +=3D ECC_ERR_CNT(*info); > >>>>>> + bitflips =3D max_t(u32, bitflips, ECC_ERR_CNT(*info)); > >>>>>> + } =20 > >>>>> > >>>>> Are you sure you handle correctly empty pages with bf? =20 > >>>>> >> if scramble is enable, i would say yes here. =20 > >>>> 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 s= end > >>>> out the ecc parity bytes. =20 > >>> > >>> Even if the ECC engine is disabled? =20 > >>> >> No. =20 > >> When ECC engine is disabled, it can read the ecc parity bytes ; but th= ere is another problem that i need to consider how code struct looks better= when reading error with ecc opened and then try to raw read. > >> Is there a good idea? =20 > >=20 > > When reading with ECC enabled, in case of uncorrectable error you > > must re-read without ECC, then check if the page is empty or not with > > the core helpers (nand_check_erased_*()). > >=20 > > Is this what you meant? > > =20 > yes. when uncorrectable ECC error, i need firstly read out the ECC bytes = without ECC engine and then use the helper nand_check_erased_ecc_chunk to c= heck if blank page. > Of course, the precondition is without scrambler, or the bland page can b= e detected by meson NFC. A suppose you meant "blank page"? If yes, then you don't need the helper to check for only-0xFF pages. If the controller tells you if the page was blank, then just check for that bit. Thanks, Miqu=C3=A8l