Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1887986imu; Sun, 18 Nov 2018 10:53:53 -0800 (PST) X-Google-Smtp-Source: AJdET5cr26eJnGnb3TbwRd10IminxvV3OSQOtavGME6ffK8zt0HYo5mhRusBVlQD1r05CQbUIRd6 X-Received: by 2002:a62:5793:: with SMTP id i19mr15795213pfj.49.1542567233482; Sun, 18 Nov 2018 10:53:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542567233; cv=none; d=google.com; s=arc-20160816; b=XSLHZWHiHmFo9ZDg95ah1JlsVZIoNbd9EE7Ib4USS7rXlh0YsojMHSx1q8vH8j2arF cYx897WK5aqa4Gddqz5fjPRMepLBNmxpV0jNkEw6Zc1mhwVsP6qLjMLEmeoWgeWRH5dd zpGEFO3DDPJyEjYIy8eJoj3T9nEn4oWbnqbc5ZStN50rKChB2wHP5yuTaPFs6J/juT8B e+Hnabl42emv98/6XfJeMcnwnykaS4w/iJpoufm38YIRKyzfwoM9Lvvl+uIv9qvBksK0 61MYXwENwzo+RpiRlh1DVA61k8uKMy6EIO1xI0sL1t+fGvJyvP6kaD+0BzCZJqNtsEPs 6D5Q== 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=4viGairfWRgmA8Le3ovx87CoPiczSD8otdONaZQHT+w=; b=Iq7OyVL/XsoLiSntSsQodKdGM8Z/PNbmk341NZQP9SfvFrcuR0AwarPT2S+aSzueYY 64TJFoxEFG3Ylnu3Kl3KUE1iAGxXkPeiAuO3Wm8crzHE4L+ljJgHeym2sjSp3xFp6avz qQR8XPvPf5o77kohjTB1H/6VdarxVgt0SpefvYOio8ApP9OFhCDi+++zgdSeSrivwbpA bJ/uYBS63ZXtnM/y5APqhDjLOYuPFHGLbahojdCj7KQAWTRa+apwOul0K3oSUtHfflVm SeMdrNzUihdrDycb5p0hzYHXQI91kc+MMLvegv93ONLbGa+Y/DipLd6ItS2iwPFG/2O1 Hkyg== 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 az5si16953765plb.166.2018.11.18.10.53.37; Sun, 18 Nov 2018 10:53:53 -0800 (PST) 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 S1725904AbeKSFOD convert rfc822-to-8bit (ORCPT + 99 others); Mon, 19 Nov 2018 00:14:03 -0500 Received: from mail.bootlin.com ([62.4.15.54]:57400 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725755AbeKSFOD (ORCPT ); Mon, 19 Nov 2018 00:14:03 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id B4CE1207B0; Sun, 18 Nov 2018 19:52:59 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.2 Received: from xps13 (unknown [91.224.148.103]) by mail.bootlin.com (Postfix) with ESMTPSA id 228752074F; Sun, 18 Nov 2018 19:52:59 +0100 (CET) Date: Sun, 18 Nov 2018 19:52:58 +0100 From: Miquel Raynal To: Naga Sureshkumar Relli Cc: "boris.brezillon@bootlin.com" , "richard@nod.at" , "dwmw2@infradead.org" , "computersforpeace@gmail.com" , "marek.vasut@gmail.com" , "nagasuresh12@gmail.com" , Michal Simek , "linux-mtd@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "robh@kernel.org" Subject: Re: [LINUX PATCH v12 3/3] mtd: rawnand: arasan: Add support for Arasan NAND Flash Controller Message-ID: <20181118195258.4966e2c4@xps13> In-Reply-To: References: <1541739641-17789-1-git-send-email-naga.sureshkumar.relli@xilinx.com> <1541739641-17789-4-git-send-email-naga.sureshkumar.relli@xilinx.com> Organization: Bootlin X-Mailer: Claws Mail 3.16.0 (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 Naga, Naga Sureshkumar Relli wrote on Thu, 15 Nov 2018 09:34:16 +0000: > Hi Boris & Miquel, > > I am updating the driver by addressing your comments, and I have one concern, especially in anfc_read_page_hwecc(), > there I am checking for erased pages bit flips. > Since Arasan NAND controller doesn't have multibit error detection beyond 24-bit( it can correct up to 24 bit), > i.e. there is no indication from controller to detect uncorrectable error beyond 24bit. > So I took some error count as default value(MULTI_BIT_ERR_CNT 16, I put this based on the error count that > I got while reading erased page on Micron device). > And during a page read, will just read the error count register and compare this value with the default error count(16) and if it is more > Than default then I am checking for erased page bit flips. > I am doubting that this will not work in all cases. > In my case it is just working because the error count that it got on an erased page is 16. > Could you please suggest a way to do detect erased_page bit flips when reading a page with HW-ECC?. So the ECC engine is broken by design. I think you should determine a number of bitflips (16 looks nice to me) over which you declare the page bad anyway. Now, this is generic logic: anytime a page is declared bad, you should re-read the page in raw mode and check for the number of bitflips manually (thanks to the helpers in the core). Again, if the number of BF is above 16, we can assume the page is bad and increment ->ecc.failed accordingly. Thanks, Miquèl