From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 26 Apr 2016 09:51:28 +0200 From: Stefan Christ To: Markus Pargmann Cc: Han Xu , David Woodhouse , Boris BREZILLON , Fabio Estevam , linux-mtd@lists.infradead.org, kernel@pengutronix.de, Huang Shijie , Brian Norris , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2] gpmi-nand: Handle ECC Errors in erased pages Message-ID: <20160426075128.GC2351@lws-christ> References: <1461587712-16403-1-git-send-email-mpa@pengutronix.de> MIME-Version: 1.0 In-Reply-To: <1461587712-16403-1-git-send-email-mpa@pengutronix.de> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Hi, On Mon, Apr 25, 2016 at 02:35:12PM +0200, Markus Pargmann wrote: > ECC is only calculated for written pages. As erased pages are not > actively written the ECC is always invalid. For this purpose the > Hardware BCH unit is able to check for erased pages and does not raise > an ECC error in this case. This behaviour can be influenced using the > BCH=5FMODE register which sets the number of allowed bitflips in an erased > page. Unfortunately the unit is not capable of fixing the bitflips in > memory. >=20 > To avoid complete software checks for erased pages, we can simply check > buffers with uncorrectable ECC errors because we know that any erased > page with errors is uncorrectable by the BCH unit. >=20 > This patch adds the generic nand=5Fcheck=5Ferased=5Fecc=5Fchunk() to gpmi= -nand > to correct erased pages. To have the valid data in the buffer before > using them, this patch moves the read=5Fpage=5Fswap=5Fend() call before t= he > ECC status checking for-loop. >=20 > Signed-off-by: Markus Pargmann > [Squashed patches by Stefan and Boris to check ECC area] > Cc: Stefan Christ > Cc: Boris Brezillon >=20 > Signed-off-by: Markus Pargmann Tested-by: Stefan Christ I verified the fix again on our board. Mit freundlichen Gr=C3=BC=C3=9Fen / Kind regards, Stefan Christ