From patchwork Wed Mar 22 20:07:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 95846 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp415394qgd; Wed, 22 Mar 2017 13:17:47 -0700 (PDT) X-Received: by 10.98.55.66 with SMTP id e63mr39784154pfa.100.1490213867918; Wed, 22 Mar 2017 13:17:47 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id f1si3007635plf.93.2017.03.22.13.17.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2017 13:17:47 -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; dkim=neutral (body hash did not verify) header.i=@nifty.com; 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=IYv9SAVh5CTMzChI2WmvkJrozpb2wBNNi6cfg1ZwO+s=; b=Xm3+kbvR6EAaG4kB3P75NR+wI+ 3Jz4eXtxZwhtm5hA5h+c/SzbmFpJevSXMwGlXZg1/nLEMHN3i2bAbs5JAz/G3kCD+l7HZgw1OR5kE 2ATZ/GQiWlCiJSRznBhv0QSfrzCOHuppTdsbIg67Q18NvDn9rk1sC/nfCzgFGvYqrn8NtWQX6ONp0 yvoEBE9drhqLDxj4jwOlrbdZQ+xv4sqbIMOpsZ38FReCtMFx1x/tTHfRgziNy+WFpJ0c0ilGoHp0I vLRuws1mjUPU/c32vCtOKH//9OMSQuHOH1XYXjWAFpIBpRUNZ3inGIDhdif8H/chErmP72ZMl/gKs hYy8VoTA==; 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 1cqmhR-0006BJ-Ui; Wed, 22 Mar 2017 20:17:41 +0000 Received: from conuserg-07.nifty.com ([210.131.2.74]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cqmZN-0001Rc-EV for linux-mtd@lists.infradead.org; Wed, 22 Mar 2017 20:09:28 +0000 Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-07.nifty.com with ESMTP id v2MK895p029452; Thu, 23 Mar 2017 05:08:18 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com v2MK895p029452 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1490213299; bh=K5pAGjBBkTdjVGiDIObZj3HixB3zRpLnJkyh+7jwstc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xLw8QMext5OtFfSsG06PbpPH+tt4seaTGXMK+PCvkgxh20aEoXbBaB1twOYWd5Keb 8C1WlRCg3W8yf44MkNZKyfGNO0lj4xoVOYgxDu+8uPRv0Ie8JbUxXg9XCcyQVWFuru HU9pqGAOXMKuBpLrIuQIzo8RNsRKiiTEDgE4VfWitIgRJCxfGHBOBc+OmuhmPxfbJE 4Nl0+ajNDdOsOqv5ST2PYMgXNarsnmoofh8Arokwy06E/SQjBhhKl9nTnKJG0t9rS7 Yo5j2sXa6+JWPi4ed17rcE4QaQf9T7SB+43MPtog6cC9JynzEB1LcbmG3JWnW0Tf7v 3OygnrAJHZ9Mw== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Subject: [RESEND PATCH v2 01/53] mtd: nand: allow to set only one of ECC size and ECC strength from DT Date: Thu, 23 Mar 2017 05:07:00 +0900 Message-Id: <1490213273-8571-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490213273-8571-1-git-send-email-yamada.masahiro@socionext.com> References: <1490213273-8571-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170322_130922_052283_280C8999 X-CRM114-Status: GOOD ( 10.35 ) X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: laurent.monat@idquantique.com, Boris Brezillon , thorsten.christiansson@idquantique.com, Richard Weinberger , Marek Vasut , Masahiro Yamada , Artem Bityutskiy , Cyrille Pitchen , linux-kernel@vger.kernel.org, Dinh Nguyen , Masami Hiramatsu , Chuanxiao Dong , Jassi Brar , Brian Norris , Enrico Jorns , David Woodhouse , Graham Moore MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org Currently, it is valid to specify both "nand-ecc-step-size" and "nand-ecc-strength", but not allowed to set only one of them. This requirement has a conflict with "nand-ecc-maximize"; this flag is used when you want the driver to choose the best ECC strength. If "nand-ecc-maximize" is set, "nand-ecc-strength" is very likely to be unset. It would be possible to make the if-conditional more complex by adding the check for the NAND_ECC_MAXIMIZE flag, but I chose to drop the check entirely. I thought of the situation where the hardware has a fixed ECC step size (so it can be hard-coded in the driver), whereas the ECC strength is configurable by software. In that case, we may want to only set "nand-ecc-strength" (or "nand-ecc-maximize") in DT. Signed-off-by: Masahiro Yamada --- The Denali NAND is the case. The ecc.size is fixed when the RTL is delivered, while the driver can choose ecc.strength from some supported values. For Intel and Altera, available ecc.strength are 8, 15. For Socionext UniPhier, available ecc.strength are 8, 16, 24. Changes in v2: None drivers/mtd/nand/nand_base.c | 6 ------ 1 file changed, 6 deletions(-) -- 2.7.4 ______________________________________________________ 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 b0524f8..a3c0f47 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -4333,12 +4333,6 @@ static int nand_dt_init(struct nand_chip *chip) ecc_strength = of_get_nand_ecc_strength(dn); ecc_step = of_get_nand_ecc_step_size(dn); - if ((ecc_step >= 0 && !(ecc_strength >= 0)) || - (!(ecc_step >= 0) && ecc_strength >= 0)) { - pr_err("must set both strength and step size in DT\n"); - return -EINVAL; - } - if (ecc_mode >= 0) chip->ecc.mode = ecc_mode;