Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756448AbcLBE3I (ORCPT ); Thu, 1 Dec 2016 23:29:08 -0500 Received: from conssluserg-03.nifty.com ([210.131.2.82]:18066 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752437AbcLBE3H (ORCPT ); Thu, 1 Dec 2016 23:29:07 -0500 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com uB24SOvw004826 X-Nifty-SrcIP: [209.85.161.173] MIME-Version: 1.0 In-Reply-To: <20161127163114.24e9b8ad@bbrezillon> References: <1480183585-592-1-git-send-email-yamada.masahiro@socionext.com> <1480183585-592-14-git-send-email-yamada.masahiro@socionext.com> <20161127163114.24e9b8ad@bbrezillon> From: Masahiro Yamada Date: Fri, 2 Dec 2016 13:28:23 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 13/39] mtd: nand: denali: increment ecc_stats->corrected To: Boris Brezillon Cc: linux-mtd@lists.infradead.org, Linux Kernel Mailing List , Marek Vasut , Brian Norris , Richard Weinberger , David Woodhouse , Cyrille Pitchen Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1294 Lines: 43 Hi Boris, 2016-11-28 0:31 GMT+09:00 Boris Brezillon : > 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. > You are right. This patch is completely wrong, so I will drop it in v2. -- Best Regards Masahiro Yamada