From patchwork Sat Nov 26 18:05:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 699518 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tR1M36nv2z9s9Y for ; Sun, 27 Nov 2016 05:15:11 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="ok/3U3vH"; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cAhU6-0002C7-CZ; Sat, 26 Nov 2016 18:13:58 +0000 Received: from conuserg-11.nifty.com ([210.131.2.78]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cAhNm-00050x-QY for linux-mtd@lists.infradead.org; Sat, 26 Nov 2016 18:07:35 +0000 Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-11.nifty.com with ESMTP id uAQI6Ueh018512; Sun, 27 Nov 2016 03:06:42 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com uAQI6Ueh018512 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1480183602; bh=y3L8a9BHg+doASOuySx/rZWhYIAkZryEHoq9UzpfNys=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ok/3U3vHl7Nhtodfr8fhkIJe7Pf2k3N71hZOXvUmVj/Reeab54v7PGlEu+URlvaX5 d/GAqAN+XVlV4uHnrG4SBhPIk6HM/bvfz63b1ttmTWtElhvLNw3UZ/XNmjBoON4E7n 6nkNRbu/WlqpAUkgslFJT+PyUkBJfPBS44PPunnQ1ihxBAYdTyBdTM3adPg7rVN1Bs dA+R7swf4m2YjWgl6sX15f+HBKbAeTZYicsBHvp4uCSbJM6rRXY+p+olrRibCPXm2P WH+Pw5W4xinMlE4VePRDzKUqMU936JrhZ4RH3kBS7SS1LSG5YsQeCLIK33RjdfaTAl DT/i3XlbAFEPQ== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Subject: [PATCH 11/39] mtd: nand: denali: increment ecc_stats.failed by one per error Date: Sun, 27 Nov 2016 03:05:57 +0900 Message-Id: <1480183585-592-12-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480183585-592-1-git-send-email-yamada.masahiro@socionext.com> References: <1480183585-592-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161126_100728_290362_B9087344 X-CRM114-Status: UNSURE ( 8.92 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_L4 RBL: Bad reputation (-4) [210.131.2.78 listed in bl.mailspike.net] 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 RCVD_IN_MSPIKE_BL Mailspike blacklisted X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Boris Brezillon , Marek Vasut , Richard Weinberger , linux-kernel@vger.kernel.org, Masahiro Yamada , Cyrille Pitchen , Brian Norris , David Woodhouse MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org If the addressed page is not erased, the two calls of is_erase() will both return false, then mtd->ecc_stats.failed will be incremented by two. Rather, increment it by one because the whole page including OOB area is transferred in one transaction. Signed-off-by: Masahiro Yamada --- drivers/mtd/nand/denali.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c index ab59371..ae9a8d2 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c @@ -1157,9 +1157,8 @@ static int denali_read_page(struct mtd_info *mtd, struct nand_chip *chip, read_oob_data(mtd, chip->oob_poi, denali->page); /* check ECC failures that may have occurred on erased pages */ - if (!is_erased(buf, mtd->writesize)) - mtd->ecc_stats.failed++; - if (!is_erased(chip->oob_poi, mtd->oobsize)) + if (!is_erased(buf, mtd->writesize) || + !is_erased(chip->oob_poi, mtd->oobsize)) mtd->ecc_stats.failed++; } return max_bitflips;