From patchwork Tue May 2 08:13:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Couzens X-Patchwork-Id: 98414 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp1759547qgf; Tue, 2 May 2017 01:14:09 -0700 (PDT) X-Received: by 10.84.217.201 with SMTP id d9mr17722193plj.164.1493712849390; Tue, 02 May 2017 01:14:09 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id f5si7619184plm.45.2017.05.02.01.14.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 May 2017 01:14:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=2at22rFUZgM4ViaUOTGeVG1RMBjHnU8J/FZ7HhtxH+Y=; b=VvelFPbXSBcjt7PSHCuVzS4TRi lHP+u1K7fjIw9pUONU+cR8SqLCSNcQOk+J6vTq+KsGRMgR7s3gLMZN6jtAqXfapcZq/h0Wg8+7e2E qV3etB8ErDG/YJiIhwI4xSLkD1bPjrXa7E+mLCBJsISKsDY3/5yv9+Bel0f+pHBimUHJ4czIccY27 5eHC2zZbPGhmErY0vzmUsjTuAWDGTa8Agqw16PFMQEMfWGHlxFhvFXmkH8Itlx+bXYQ5aTPFEeS5t cV+CHgy7ZyJkIMyt45/0ZnAvzC7LR0j5V0NI5XjFYOhYEw98u/4B0ZO2XokrGCoptP2Xd7xjB7zLG uff3s5eg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d5Swf-0005Px-J3; Tue, 02 May 2017 08:14:05 +0000 Received: from mail.base45.de ([2001:67c:2050:310::a:2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d5Swc-0005Ki-5O for linux-mtd@lists.infradead.org; Tue, 02 May 2017 08:14:04 +0000 Received: from ip5b4049fd.dynamic.kabel-deutschland.de ([91.64.73.253] helo=lazus.yip) by mail.base45.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1d5SwD-0002Yz-8S; Tue, 02 May 2017 10:13:37 +0200 From: Alexander Couzens To: linux-mtd@lists.infradead.org Subject: [PATCH 2/3][v2] nand_base: use nand_ooblayout_lp_hamming_ops for 1bit hamming as default Date: Tue, 2 May 2017 10:13:22 +0200 Message-Id: <20170502081323.3138-3-lynxis@fe80.eu> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170502081323.3138-1-lynxis@fe80.eu> References: <20170313074641.28b383e7@bbrezillon> <20170502081323.3138-1-lynxis@fe80.eu> In-Reply-To: <20170313074641.28b383e7@bbrezillon> References: <20170313074641.28b383e7@bbrezillon> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170502_011402_459450_43CEAAA0 X-CRM114-Status: UNSURE ( 7.70 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Boris Brezillon , Alexander Couzens , Richard Weinberger MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org commit 41b207a70d3a ("mtd: nand: implement the default mtd_ooblayout_ops") uses a different ooblayout for platforms which doesn't set the layout by itself. Use for 1bit hamming the old layout. Signed-off-by: Alexander Couzens --- drivers/mtd/nand/nand_base.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.12.2 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index daf3df157885..6a9e99377181 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -4724,7 +4724,11 @@ int nand_scan_tail(struct mtd_info *mtd) break; case 64: case 128: - mtd_set_ooblayout(mtd, &nand_ooblayout_lp_ops); + if (ecc->algo == NAND_ECC_HAMMING && ecc->strength == 1) + mtd_set_ooblayout(mtd, + &nand_ooblayout_lp_hamming_ops); + else + mtd_set_ooblayout(mtd, &nand_ooblayout_lp_ops); break; default: WARN(1, "No oob scheme defined for oobsize %d\n",