Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752580AbcK0Pb2 (ORCPT ); Sun, 27 Nov 2016 10:31:28 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:38059 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751918AbcK0Pb0 (ORCPT ); Sun, 27 Nov 2016 10:31:26 -0500 Date: Sun, 27 Nov 2016 16:31:14 +0100 From: Boris Brezillon To: Masahiro Yamada Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Marek Vasut , Brian Norris , Richard Weinberger , David Woodhouse , Cyrille Pitchen Subject: Re: [PATCH 13/39] mtd: nand: denali: increment ecc_stats->corrected Message-ID: <20161127163114.24e9b8ad@bbrezillon> In-Reply-To: <1480183585-592-14-git-send-email-yamada.masahiro@socionext.com> References: <1480183585-592-1-git-send-email-yamada.masahiro@socionext.com> <1480183585-592-14-git-send-email-yamada.masahiro@socionext.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1132 Lines: 36 On Sun, 27 Nov 2016 03:05:59 +0900 Masahiro Yamada wrote: > Update the number of corrected bit flips when read_page() succeeds. > > Signed-off-by: Masahiro Yamada > --- > > drivers/mtd/nand/denali.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c > index a6445d9..4cc8945 100644 > --- a/drivers/mtd/nand/denali.c > +++ b/drivers/mtd/nand/denali.c > @@ -1162,6 +1162,9 @@ static int denali_read_page(struct mtd_info *mtd, struct nand_chip *chip, > mtd->ecc_stats.failed++; > return 0; > } > + > + mtd->ecc_stats.corrected += max_bitflips; First of all, ecc_stats.corrected should contain the total number of bitflips detected on the MTD device, here you're just adding the maximum number of bitflips per ECC chunk for the current page, which is slightly different. Then, ecc_stats.corrected seems to be properly updated in handle_ecc() [1], so I see no reason to do it here. [1]http://lxr.free-electrons.com/source/drivers/mtd/nand/denali.c#L1003 > + > return max_bitflips; > } >