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: 84286 Delivered-To: patch@linaro.org Received: by 10.182.1.168 with SMTP id 8csp786907obn; Sat, 26 Nov 2016 10:11:08 -0800 (PST) X-Received: by 10.84.131.65 with SMTP id 59mr30518241pld.79.1480183868619; Sat, 26 Nov 2016 10:11:08 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u189si38765278pgc.151.2016.11.26.10.11.08; Sat, 26 Nov 2016 10:11:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753754AbcKZSLD (ORCPT + 25 others); Sat, 26 Nov 2016 13:11:03 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:48674 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753339AbcKZSIv (ORCPT ); Sat, 26 Nov 2016 13:08:51 -0500 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 Cc: Masahiro Yamada , linux-kernel@vger.kernel.org, Boris Brezillon , Marek Vasut , Brian Norris , Richard Weinberger , David Woodhouse , Cyrille Pitchen 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(-) -- 2.7.4 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;