Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp700203ybm; Tue, 21 May 2019 01:55:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqyS+bO4TMn7PAyheutpEBoTG1LEOfFbHs77RBfhJ++UA5fADOoGusLAmqCgwXK0Ch/Wd0MF X-Received: by 2002:a63:e451:: with SMTP id i17mr81140552pgk.312.1558428957730; Tue, 21 May 2019 01:55:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558428957; cv=none; d=google.com; s=arc-20160816; b=l/HUKdG1PWo08lojw02stp1UCJ+ypXtBWjLGlz2CbqxFtrtwG/1lo2Rr1+bU3uEiBL 2jxEKv5mi/huYL/HFotJootcQW4CMnLsMGoUvuR33cpDLXwA9fleXhXCM9xrP7cxvcD5 GwOuBl0UquE4osxEYu0BZNmBZ0cZBMqr31mzw1SQN/yDPZ1rNHWG4uvbtCAKzPKdyy/e 0201kXXXpGsp3HOmCrfigmQSiNNlaDgoM48ArbaUGE+AUSTICC1oib3TdVeV1BiYaHk/ WVclFZ8FucmDTLXkwk2gF1A8McO7DvurDmNZBfiIzDj5qFqXoUuUi0nGmNLW5C3acMMm QKYg== 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=YEFnuwQAPPnFoHE1jwJh/Kan3D+o+qAYCuzG8ULUot8=; b=CXvjaXuERMTTQxc5kxMYESNFt1452be1OLj03R6OMG/+BsTKEO0YvJ/wwovj7FK4Ut imUJYWlU/8Me2CItoqj6QfNkVSTvrTn7OnvjJvyrnWOFINEvLkTzU8iTJB3PPwRUPOK2 p2YWBB49ExDdGYFXj0aKDdto5FUPUQ75yjlILJfE6NNMOC6QxihZ8uuKR1XtbbPAfzso GIfFGgzeC7JIj9J0tfPs20teMZqaTRVdTJpZT0uC6D+DkgopvzrKthKLS9mbIz5DlC+R 4o8c5+2jT5KLZLK9sxQsMH9bxSMUUVNpJNU+XVWB3rlKbTxN4GSDFsPgU81HzXeNxjMC bU2A== 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 t5si18948376pgv.164.2019.05.21.01.55.43; Tue, 21 May 2019 01:55:57 -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 S1727222AbfEUIxy convert rfc822-to-8bit (ORCPT + 99 others); Tue, 21 May 2019 04:53:54 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:53337 "EHLO relay7-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726259AbfEUIxy (ORCPT ); Tue, 21 May 2019 04:53:54 -0400 X-Originating-IP: 90.88.22.185 Received: from xps13 (aaubervilliers-681-1-80-185.w90-88.abo.wanadoo.fr [90.88.22.185]) (Authenticated sender: miquel.raynal@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id BC2E420015; Tue, 21 May 2019 08:53:50 +0000 (UTC) Date: Tue, 21 May 2019 10:53:49 +0200 From: Miquel Raynal To: Florian Fainelli Cc: Kamal Dasu , 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 v2 2/2] mtd: nand: raw: brcmnand: fallback to detected ecc-strength, ecc-step-size Message-ID: <20190521105349.3b6562f2@xps13> In-Reply-To: <63bbd3eb-60c1-042c-633c-cfa6fbef528c@gmail.com> References: <1558379144-28283-1-git-send-email-kdasu.kdev@gmail.com> <1558379144-28283-2-git-send-email-kdasu.kdev@gmail.com> <63bbd3eb-60c1-042c-633c-cfa6fbef528c@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 Florian, Florian Fainelli wrote on Mon, 20 May 2019 12:11:42 -0700: > On 5/20/19 12:05 PM, Kamal Dasu wrote: > > This change supports nand-ecc-step-size and nand-ecc-strength fields in > > brcmnand DT node to be optional. > > 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, raw NAND layer does detect ECC information by > > reading ONFI extended parameter page for parts using ONFI >= 2.1. > > In case of non-ONFI NAND parts there could be a nand_id table entry with > > ECC information. If there is 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 | 11 +++++++++++ > > 1 file changed, 11 insertions(+) > > > > diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c > > index ce0b8ff..a4d2057 100644 > > --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c > > +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c > > @@ -2144,6 +2144,17 @@ static int brcmnand_setup_dev(struct brcmnand_host *host) > > return -EINVAL; > > } > > > > + if (chip->ecc.mode != NAND_ECC_NONE && > > + (!chip->ecc.size || !chip->ecc.strength)) { > > + if (chip->base.eccreq.step_size && chip->base.eccreq.strength) { > > + /* use detected ECC parameters */ > > + chip->ecc.size = chip->base.eccreq.step_size; > > + chip->ecc.strength = chip->base.eccreq.strength; > > + pr_info("Using ECC step-size %d, strength %d\n", > > + chip->ecc.size, chip->ecc.strength); > > Nit: should not we use dev_info(&host->pdev->dev) for printing the > message in case we have multiple NAND controllers on chip, that way we > can still differentiate them from the prints? With the above changed Reviewed-by: Miquel Raynal Thanks, Miquèl