Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp103751yba; Mon, 20 May 2019 05:46:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwXeYyRTVta9L1DJiaoopuaf2AsXnwW3W8k01bmPJ8u8pBJdOUlRU1GkQHmcQjvEtsa9tH3 X-Received: by 2002:a17:902:6b44:: with SMTP id g4mr75391375plt.157.1558356394931; Mon, 20 May 2019 05:46:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558356394; cv=none; d=google.com; s=arc-20160816; b=z0U9hBvvQbsaMnBxUKutP/f5P9Gnkkd3y2BJA1GCm+UVQQs3jnncUwVuPBh9zx8iub CxuAL+sWznQRghMaZCj0r7SMKmjXv75Q3SZjbA/GEpSEintKDqQhwLfNp/OCkTvpOFAG i0Q7ZBlHqxRRjvep2Jcl4M//GfNU7ZddcmzIbcZ0MLxh9OKnNjSHGOM5cWe7y0Q4FdZF OGJ2NpGzfumCTvjvl9BxHfM98NA0K6Lb5v4eBXCPY6qL+pYGoZCAtAN0KqpiSQEzZ3Pz mS0iBUh6HMp8x4VEoNkc6fTIuwapavYzWw1/Bl75tKS1dREof1e+gzLzNsRLUUmGaqVP wIPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=YZYXB44fJbTdWsUbQuorlY11E/AV3Rb0Ec/PTjjQ3rM=; b=OTqQ84v6q54d0Ud6u7pHJ4UmedWFw65YMSGKxoCD15ko2jgWCNTRtrIocMcF0Q5/WW hyR5G4jQgj7QfzblrfVqpZWF3mWI/S1jSTBYZBOVYv2OU0WjCwfgFuxNvbZrCk/uNp41 KMk5SuPSxNzkCaGzgUJhzD4dUuo5ZeeUhF4W2IC3A/c2icymiQvSiVzmA/C38wd3ErvX rox4YG5IDWoN+nOQpG8FeY2LfAnGfhr2TabcUTX0tMVAOT8oaFgTkX1f25oGKAhLNpvz cf+tuH6otvnKmgDOP6VQseE/OZX05uuDJHO0vMYGajPA3Jabr3+pnUvZGqTNELs6bxH7 SOrA== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a23si17452493plm.385.2019.05.20.05.46.20; Mon, 20 May 2019 05:46:34 -0700 (PDT) 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; 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 S2391310AbfETMom convert rfc822-to-8bit (ORCPT + 99 others); Mon, 20 May 2019 08:44:42 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:44733 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391303AbfETMoj (ORCPT ); Mon, 20 May 2019 08:44:39 -0400 Received: from xps13 (aaubervilliers-681-1-80-185.w90-88.abo.wanadoo.fr [90.88.22.185]) (Authenticated sender: miquel.raynal@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 30D24100010; Mon, 20 May 2019 12:44:37 +0000 (UTC) Date: Mon, 20 May 2019 14:44:36 +0200 From: Miquel Raynal To: Kamal Dasu Cc: linux-mtd@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, Brian Norris , Richard Weinberger , David Woodhouse , Marek Vasut , Vignesh Raghavendra Subject: Re: [PATCH 2/2] mtd: nand: raw: brcmnand: fallback to detected ecc-strength, ecc-step-size Message-ID: <20190520144436.67e42f00@xps13> In-Reply-To: <1558117914-35807-2-git-send-email-kdasu.kdev@gmail.com> References: <1558117914-35807-1-git-send-email-kdasu.kdev@gmail.com> <1558117914-35807-2-git-send-email-kdasu.kdev@gmail.com> Organization: Bootlin X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kamal, Kamal Dasu wrote on Fri, 17 May 2019 14:29:55 -0400: > This change supports nand-ecc-step-size and nand-ecc-strenght fields in strength > brcmnand dt node to be optional. DT ^ extra space > see: Documentation/devicetree/bindings/mtd/brcm,brcmnand.txt > > If both nand-ecc-strength and nand-ecc-step-size are not specified in > device tree node for NAND, nand_base driver does detect onfi ext ecc s/nand_base driver/the raw NAND layer/ s/onfi/ONFI/ s/ecc/ECC/ What is "ext"? Please use plain English here. > info from ONFI extended parameter page for parts using ONFI >= 2.1. In s/info/information/ > case of non-onfi NAND there could be a nand_id table entry with the ecc s/ecc/ECC/ > info. If there is a valid device tree entry for nand-ecc-strength and > nand-ecc-step-size fields it still shall override the detected values. > > Signed-off-by: Kamal Dasu > --- > drivers/mtd/nand/raw/brcmnand/brcmnand.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c > index ce0b8ff..e967b30 100644 > --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c > +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c > @@ -2144,6 +2144,16 @@ static int brcmnand_setup_dev(struct brcmnand_host *host) > return -EINVAL; > } > > + if (!(chip->ecc.size > 0 && chip->ecc.strength > 0) && Is the case where only size OR strength is valid handled? > + (chip->base.eccreq.strength > 0 && > + chip->base.eccreq.step_size > 0)) { > + /* use detected ecc parameters */ Use ECC > + chip->ecc.size = chip->base.eccreq.step_size; > + chip->ecc.strength = chip->base.eccreq.strength; > + pr_info("Using detected nand-ecc-step-size %d, nand-ecc-strength %d\n", > + chip->ecc.size, chip->ecc.strength); > + } > + > switch (chip->ecc.size) { > case 512: > if (chip->ecc.algo == NAND_ECC_HAMMING) Thanks, Miquèl