[{"id":1961101,"web_url":"http://patchwork.ozlabs.org/comment/1961101/","msgid":"<20180725175709.4ad7541e@bbrezillon>","list_archive_url":null,"date":"2018-07-25T15:57:09","subject":"Re: [PATCH v5 13/17] mtd: rawnand: txx9ndfmc: clarify ECC\n\tparameters assignation","submitter":{"id":73370,"url":"http://patchwork.ozlabs.org/api/people/73370/","name":"Boris Brezillon","email":"boris.brezillon@bootlin.com"},"content":"On Wed, 25 Jul 2018 15:31:48 +0200\nMiquel Raynal <miquel.raynal@bootlin.com> wrote:\n\n> A comment in the probe declares that values are assigned to ecc.size\n> and ecc.bytes, but these values will be overwritten. This is not\n> entirely right as they are overwritten only if\n> mtd->writesize >= 512. Let's clarify this by moving these assignations\n> to txx9ndfmc_nand_scan().\n> \n> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>\n\nReviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>\n\n> ---\n>  drivers/mtd/nand/raw/txx9ndfmc.c | 8 ++++----\n>  1 file changed, 4 insertions(+), 4 deletions(-)\n> \n> diff --git a/drivers/mtd/nand/raw/txx9ndfmc.c b/drivers/mtd/nand/raw/txx9ndfmc.c\n> index 9019022774f7..9808b18b15e2 100644\n> --- a/drivers/mtd/nand/raw/txx9ndfmc.c\n> +++ b/drivers/mtd/nand/raw/txx9ndfmc.c\n> @@ -262,10 +262,13 @@ static int txx9ndfmc_nand_scan(struct mtd_info *mtd)\n>  \tret = nand_scan_ident(mtd, 1, NULL);\n>  \tif (!ret) {\n>  \t\tif (mtd->writesize >= 512) {\n> -\t\t\t/* Hardware ECC 6 byte ECC per 512 Byte data */\n>  \t\t\tchip->ecc.size = 512;\n>  \t\t\tchip->ecc.bytes = 6;\n> +\t\t} else {\n> +\t\t\tchip->ecc.size = 256;\n> +\t\t\tchip->ecc.bytes = 3;\n>  \t\t}\n> +\n>  \t\tret = nand_scan_tail(mtd);\n>  \t}\n>  \treturn ret;\n> @@ -332,9 +335,6 @@ static int __init txx9ndfmc_probe(struct platform_device *dev)\n>  \t\tchip->ecc.correct = txx9ndfmc_correct_data;\n>  \t\tchip->ecc.hwctl = txx9ndfmc_enable_hwecc;\n>  \t\tchip->ecc.mode = NAND_ECC_HW;\n> -\t\t/* txx9ndfmc_nand_scan will overwrite ecc.size and ecc.bytes */\n> -\t\tchip->ecc.size = 256;\n> -\t\tchip->ecc.bytes = 3;\n>  \t\tchip->ecc.strength = 1;\n>  \t\tchip->chip_delay = 100;\n>  \t\tchip->controller = &drvdata->controller;","headers":{"Return-Path":"<linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org\n\t(client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdmarc=none (p=none dis=none) header.from=bootlin.com","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"BqUU+xa6\"; \n\tdkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[IPv6:2607:7c80:54:e::133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 41bKcw2btFz9rxs\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 26 Jul 2018 01:57:50 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))\n\tid 1fiMAZ-0007xU-0b; Wed, 25 Jul 2018 15:57:43 +0000","from mail.bootlin.com ([62.4.15.54])\n\tby bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))\n\tid 1fiMAW-0007wP-09\n\tfor linux-mtd@lists.infradead.org; Wed, 25 Jul 2018 15:57:41 +0000","by mail.bootlin.com (Postfix, from userid 110)\n\tid 656F820703; Wed, 25 Jul 2018 17:57:28 +0200 (CEST)","from bbrezillon (AAubervilliers-681-1-78-122.w90-88.abo.wanadoo.fr\n\t[90.88.20.122])\n\tby mail.bootlin.com (Postfix) with ESMTPSA id CC9A2209A7;\n\tWed, 25 Jul 2018 17:57:08 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:\n\tMessage-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=+u9+DkyiA3QWzd87ZqtpS+F/kyEvyWT+/vgFUTr5KZE=;\n\tb=BqUU+xa6W7NMbu\n\tOrOs+BOSGqg0PgKCby8ZUvI8bt7mnJvI8iONiUlFBuZESb5NL0DUVDxN0QM/saaTZmC8LhzFz8oQf\n\t30tR4+dF8+m0E/ymOJyYEyQtbN9aAhU0VhbaNs4iMjEK4zhLW5XZ2LNpcDmmEAcEGxubOf1IvhCd+\n\tdaKyAV7+wwv+rh49YQ2zbqTIEmOHV4Yugn5PxiqmHF8inIve+DshF4WCaKZId1tLCShX8FTC7Jile\n\t6kClxqqbD6Z1NT9KyBVBXe/ZiHRAIqEnrqrz0L3wiz/6ZNhWriTnBzu23w3ER8O1QMJ1TXR9/gj/i\n\tYUrBWUdxflsn0aMQmu1g==;","X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com","X-Spam-Level":"","X-Spam-Status":"No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT,\n\tURIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0","Date":"Wed, 25 Jul 2018 17:57:09 +0200","From":"Boris Brezillon <boris.brezillon@bootlin.com>","To":"Miquel Raynal <miquel.raynal@bootlin.com>","Subject":"Re: [PATCH v5 13/17] mtd: rawnand: txx9ndfmc: clarify ECC\n\tparameters assignation","Message-ID":"<20180725175709.4ad7541e@bbrezillon>","In-Reply-To":"<20180725133152.30898-14-miquel.raynal@bootlin.com>","References":"<20180725133152.30898-1-miquel.raynal@bootlin.com>\n\t<20180725133152.30898-14-miquel.raynal@bootlin.com>","X-Mailer":"Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu)","MIME-Version":"1.0","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20180725_085740_180473_D114FAD8 ","X-CRM114-Status":"GOOD (  18.21  )","X-Spam-Score":"-0.0 (/)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-0.0 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/,\n\tno trust [62.4.15.54 listed in list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record","X-BeenThere":"linux-mtd@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-mtd/>","List-Post":"<mailto:linux-mtd@lists.infradead.org>","List-Help":"<mailto:linux-mtd-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>","Cc":"Lucas Stach <dev@lynxeye.de>, Wenyou Yang <wenyou.yang@microchip.com>,\n\tRichard Weinberger <richard@nod.at>, Stefan Agner <stefan@agner.ch>, \n\tMarek Vasut <marek.vasut@gmail.com>, linux-mtd@lists.infradead.org,\n\tJosh Wu <rainyfeeling@outlook.com>,\n\tBrian Norris <computersforpeace@gmail.com>, \n\tDavid Woodhouse <dwmw2@infradead.org>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>","Errors-To":"linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"}}]