From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4BFCC4646B for ; Wed, 26 Jun 2019 06:48:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7BCAD20665 for ; Wed, 26 Jun 2019 06:48:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UxHzC4V5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7BCAD20665 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mtd-bounces+linux-mtd=archiver.kernel.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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=R0oT75l6bqApe1zUUtLWNhqpLSgvZWhyF/Rh2uP2B4U=; b=UxHzC4V5PeLKFE Vu/0WtCfSUTjY/3r/i8iTu7oidKHu/Nmm/9Xmg52yuEuh9vV9d+dB0LI4dfgi0ZHEYLg651z3Qn+B in3nAhezD9SgJSX40r0jgRF6rRL2dmnp9hihMNUr7PqcD7VUUDl+49cbu+QY2ASYwCyLhmILvnzHZ BIxyg0FEYx6Q7w+uLEIuTu6KwMYKcac2H/FHCPVSC3AgfBACyEoy2jPMqE0unYCQKZcU1MhHukGqe 12TByrLKwm+9bmFy0vSdHgZJg6spSMC1pxqrAyIEJcND6OL/P4HJwmd6PstWD8PBp5iqIhvmuNqfp rw+NORhxXaXR51kbvf4g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hg1j9-0003Ml-Dp; Wed, 26 Jun 2019 06:48:19 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hg1j6-0003LJ-0d for linux-mtd@lists.infradead.org; Wed, 26 Jun 2019 06:48:17 +0000 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 55B34267743; Wed, 26 Jun 2019 07:48:11 +0100 (BST) Date: Wed, 26 Jun 2019 08:48:07 +0200 From: Boris Brezillon To: Naga Sureshkumar Relli Subject: Re: [LINUX PATCH v17 1/2] mtd: rawnand: nand_micron: Do not over write driver's read_page()/write_page() Message-ID: <20190626084807.3f06e718@collabora.com> In-Reply-To: <20190625044630.31717-1-naga.sureshkumar.relli@xilinx.com> References: <20190625044630.31717-1-naga.sureshkumar.relli@xilinx.com> Organization: Collabora X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190625_234816_196748_73E8A4DF X-CRM114-Status: GOOD ( 13.16 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: vigneshr@ti.com, bbrezillon@kernel.org, helmut.grohne@intenta.de, richard@nod.at, linux-kernel@vger.kernel.org, marek.vasut@gmail.com, yamada.masahiro@socionext.com, linux-mtd@lists.infradead.org, miquel.raynal@bootlin.com, computersforpeace@gmail.com, dwmw2@infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org On Mon, 24 Jun 2019 22:46:29 -0600 Naga Sureshkumar Relli wrote: > Add check before assigning chip->ecc.read_page() and chip->ecc.write_page() > > Signed-off-by: Naga Sureshkumar Relli > --- > drivers/mtd/nand/raw/nand_micron.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/mtd/nand/raw/nand_micron.c b/drivers/mtd/nand/raw/nand_micron.c > index cbd4f09ac178..565f2696c747 100644 > --- a/drivers/mtd/nand/raw/nand_micron.c > +++ b/drivers/mtd/nand/raw/nand_micron.c > @@ -500,8 +500,11 @@ static int micron_nand_init(struct nand_chip *chip) > chip->ecc.size = 512; > chip->ecc.strength = chip->base.eccreq.strength; > chip->ecc.algo = NAND_ECC_BCH; > - chip->ecc.read_page = micron_nand_read_page_on_die_ecc; > - chip->ecc.write_page = micron_nand_write_page_on_die_ecc; > + if (!chip->ecc.read_page) > + chip->ecc.read_page = micron_nand_read_page_on_die_ecc; > + > + if (!chip->ecc.write_page) > + chip->ecc.write_page = micron_nand_write_page_on_die_ecc; That's wrong, if you don't want on-die ECC to be used, simply don't set nand-ecc-mode to "on-die". > > if (ondie == MICRON_ON_DIE_MANDATORY) { > chip->ecc.read_page_raw = nand_read_page_raw_notsupp; ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/