From patchwork Sat Nov 26 18:06:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 699537 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 3tR2r13xD7z9s65 for ; Sun, 27 Nov 2016 06:21:52 +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="cYyCvvNp"; 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 1cAiWK-0002g4-M8; Sat, 26 Nov 2016 19:20:20 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cAiVj-0001lu-3c for linux-mtd@bombadil.infradead.org; Sat, 26 Nov 2016 19:19:43 +0000 Received: from conuserg-11.nifty.com ([210.131.2.78]) by merlin.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cAhOI-0006Ou-MV for linux-mtd@lists.infradead.org; Sat, 26 Nov 2016 18:07:59 +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 uAQI6Uf6018512; Sun, 27 Nov 2016 03:07:00 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com uAQI6Uf6018512 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1480183621; bh=IGtIKzzKb4oFwjGKdrFvoyQ/fYlUmHn7HzaMWKDiFlI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cYyCvvNpyWWfOdzH0/I7oRE+WYmReffqs/ygNPJEFHU6b94o2txAz3nfRnoGcK/CA 1ewf2L2zYZ5gW4OXbXeZ9qZYA9b1gAP7IJ9VIO1/lxxGEK9dFxmuDUfNIEBft5SBME CleNZwicS2WPGw+5SGbjJj9QGuSOwAi7Svtp+91PpD3zkhY5jPv3VZXnV84X1fpLpq pUWbk/mIE2AQkKS1EjI2semCUY/KGD+Vwr+/V+DyYjwYfCNMFF+t6YyVClpyneAA+G xOXUFZ2Lq8VHvnQ5E7LeDdNqmRORdmbazZPIwqV8Kz+h5qMe7paNDiCm7VjuGX8C2R qa4OfgZiPGNsg== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Subject: [PATCH 34/39] mtd: nand: denali: fix the condition for 15 bit ECC strength Date: Sun, 27 Nov 2016 03:06:20 +0900 Message-Id: <1480183585-592-35-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_130759_158069_6F4CBB8A X-CRM114-Status: GOOD ( 12.40 ) X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.1 on merlin.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 It is valid to use the ECC when the OOB size is exactly the same as the necessary size. Signed-off-by: Masahiro Yamada --- drivers/mtd/nand/denali.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c index 5d80f16..c17e92b 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c @@ -1600,7 +1600,7 @@ int denali_init(struct denali_nand_info *denali) * SLC if possible. * */ if (!nand_is_slc(chip) && - mtd->oobsize > denali->bbtskipbytes + + mtd->oobsize >= denali->bbtskipbytes + ECC_15BITS * (mtd->writesize / chip->ecc.size)) { /* if MLC OOB size is large enough, use 15bit ECC*/ chip->ecc.strength = 15;