Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp610568ybi; Wed, 17 Jul 2019 02:05:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0rgF1cR8c4+p2NZWyaKGE8dsyoLlNDO6eZ3+4/Tt7NynfT2Ls5J2QUDY3gR2SpvFMqWH9 X-Received: by 2002:a17:902:20e9:: with SMTP id v38mr42308549plg.62.1563354350822; Wed, 17 Jul 2019 02:05:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563354350; cv=none; d=google.com; s=arc-20160816; b=TzCQY0P4Ij4kRU1huzuWq0CpHCr9xJEcJ4b3xuKRO5Pa5AJAql63E3PVN5WfBPsmhS YVrBASPfu2654s4hhu47wCR/AmUhNTMylvxEKwvd25xhUTp/zdLS1mUouhgeh3I/4Y2c a0bPxD7nxWZkchu4OQnofSOq2Lj/Y++pwBVe/dlwhWiWMAkBig6lsdM4f8vqRxf/m/Y6 tmWnwQ1aj7aQRFeAiyc1mhxIrxj8iLgSRLvUVX3Rh2h6sw9UarxkRruCgkUhBOOtaa1X /3sr8Jj5f3JRBBMI32RO80PXtUh7uoa/REgwTT4RwO9EN5RS7gz7j/kVRqE3ngihbDpD 6OJg== 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=xsQQof155y2k4wQ1X6oyKB4wSa6HsfXgBCYs5d8FpDE=; b=eRk7+G0eT7i8URQZ+K9rjK2gPfyu0tZ+8tAvIOk2xJRzpYsgkfgHD9GTxRU2tkCSHg IUWVfLaLMn12s3c2duULD3qJXP9G38suvMw9/rSxKXlbNVEra8mxH9+ERU1/QRFRxagS DcCnyYK4b5zD9Jfm5ybjKEteOsaZfXx+HbFge7EmqG5P6lzCRo23C7iyGNBph/cx8gyN 7lgel5YHQoLGWhpGTRifa7AQ96sOwcFuKdtqGxi9REuwLvJd6Xgvj3yOnNECDNywDttV vT/OFHfMxcw+zfOZJvX7F3bCBgCQxOdTEItWBpK1qT1awTZmHRASvLg3V6uVqSdlcTkh +rvA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w17si12716245plp.404.2019.07.17.02.05.34; Wed, 17 Jul 2019 02:05:50 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726683AbfGQJEZ (ORCPT + 99 others); Wed, 17 Jul 2019 05:04:25 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:41574 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725941AbfGQJEY (ORCPT ); Wed, 17 Jul 2019 05:04:24 -0400 Received: from pc-375.home (2a01cb0c88d94a005820d607da339aae.ipv6.abo.wanadoo.fr [IPv6:2a01:cb0c:88d9:4a00:5820:d607:da33:9aae]) (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 6F94428A4C3; Wed, 17 Jul 2019 10:04:22 +0100 (BST) Date: Wed, 17 Jul 2019 11:04:18 +0200 From: Boris Brezillon To: Naga Sureshkumar Relli Cc: "miquel.raynal@bootlin.com" , "bbrezillon@kernel.org" , "richard@nod.at" , "dwmw2@infradead.org" , "computersforpeace@gmail.com" , "marek.vasut@gmail.com" , "vigneshr@ti.com" , "yamada.masahiro@socionext.com" , "linux-mtd@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Michal Simek , Srikanth Vemula , "nagasuresh12@gmail.com" Subject: Re: [LINUX PATCH v18 1/2] mtd: rawnand: nand_micron: Do not over write driver's read_page()/write_page() Message-ID: <20190717110418.34453dd3@pc-375.home> In-Reply-To: <20190717102156.68aa86f7@pc-375.home> References: <20190716053051.11282-1-naga.sureshkumar.relli@xilinx.com> <20190716093137.3d8e8c1f@pc-375.home> <20190716094450.122ba6e7@pc-375.home> <20190717095525.6e2e9730@pc-375.home> <20190717102156.68aa86f7@pc-375.home> Organization: Collabora X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 17 Jul 2019 10:21:56 +0200 Boris Brezillon wrote: > On Wed, 17 Jul 2019 09:55:25 +0200 > Boris Brezillon wrote: > > > On Wed, 17 Jul 2019 05:33:35 +0000 > > Naga Sureshkumar Relli wrote: > > > > > Hi Boris, > > > > > > > -----Original Message----- > > > > From: Boris Brezillon > > > > Sent: Tuesday, July 16, 2019 1:15 PM > > > > To: Naga Sureshkumar Relli > > > > Cc: miquel.raynal@bootlin.com; bbrezillon@kernel.org; richard@nod.at; > > > > dwmw2@infradead.org; computersforpeace@gmail.com; marek.vasut@gmail.com; > > > > vigneshr@ti.com; yamada.masahiro@socionext.com; linux-mtd@lists.infradead.org; linux- > > > > kernel@vger.kernel.org; Michal Simek ; Srikanth Vemula > > > > ; nagasuresh12@gmail.com > > > > Subject: Re: [LINUX PATCH v18 1/2] mtd: rawnand: nand_micron: Do not over write > > > > driver's read_page()/write_page() > > > > > > > > On Tue, 16 Jul 2019 09:31:37 +0200 > > > > Boris Brezillon wrote: > > > > > > > > > On Mon, 15 Jul 2019 23:30:51 -0600 > > > > > Naga Sureshkumar Relli wrote: > > > > > > > > > > > Add check before assigning chip->ecc.read_page() and > > > > > > chip->ecc.write_page() > > > > > > > > > > > > Signed-off-by: Naga Sureshkumar Relli > > > > > > > > > > > > --- > > > > > > Changes in v18 > > > > > > - None > > > > > > --- > > > > > > 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; > > > > > > > > > > > > > > > > Seriously?! I told you this was inappropriate and you keep sending > > > > > this patch. So let's make it clear: > > > > > > > > > > Nacked-by: Boris Brezillon > > > > > > > > > > Fix your controller driver instead of adding hacks to the Micron logic! > > > > > > > > Not even going to review the other patch: if you have to do that, that means the driver is > > > > broken. On a side note, this patch series is still not threaded as it should be and it's a v18 for a > > > > damn NAND controller driver! Sorry but you reached the limit of my patience. Please find > > > > someone to help you with that task. > > > My intention is not to resend this 1/2 again. Sorry for that. > > > We already had some discussion on [v17 1/2], https://lkml.org/lkml/2019/6/26/430 > > > And there we didn't conclude that raw_read()/writes(). > > > > Yes, looks like I never replied to that one, but I think my previous > > explanation were clear enough to not argue on that aspect any longer/ > > > > > So I thought that, will send updated driver along with this patch, then will get more information about > > > The issue on the latest driver review. > > > > More on that topic. I don't think you ever tested on-die ECC on a > > Micron NAND, otherwise you would have noticed that your solution > > completely bypasses the on-die ECC logic (and this will clearly break > > existing on-die ECC users). See, that's what I'm complaining about, > > Looks like you don't really understand what you're doing. > > > > > There is nothing like keep on sending this patch, As you people are experts in the driver review, > > > if this patch is a hack, then we will definitely fix that in controller driver. I will find a way to do that. > > > > > > But in this flow of patch sending, if the work I did hurts you, then I am really sorry for that. > > > > I'm not offended, just tired going through the same driver over and > > over again, reporting things that are wrong/inappropriate to then > > realize you only addressed of a tiny portion of it in the following > > version. My last reviews were rather incomplete because of that, and > > now I'm giving up. > > > > > Will fix this issue in the controller driver and will send the updated one. > > > > How? You say you'll fix the issue but I'm not even sure you understand > > what the issue is? Clearly, the patch you've posted doesn't fix > > anything, it's just papering over the fact that your controller driver > > is not supporting raw accesses (or at least, not supporting it > > properly). > > > > Have you even looked at the datasheet you pointed to in patch 2 [1]? > > Just went through it, and found a field that's supposed to control the > > ECC engine activation: ecc_memcfg.ecc_mode. I don't see anything > > changing that field in your code, so I guess raw accesses are actually > > not really happening with the ECC engine disabled... > > Looks like I was wrong about that part, you seem to call > pl353_smc_set_ecc_mode(), just not in the right place (this should be > done in the read/write_page_raw()). I'm wrong again. ECC should be in BYPASS mode by default and you should enable it when entering pl353_nand_{read,write}_page() and disable it (put it back to BYPASS mode) when leaving those functions. This way, you don't even have to implement your own raw accessors and can use nand_{read,write}_page_raw() instead.