Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5242070imu; Wed, 19 Dec 2018 07:55:20 -0800 (PST) X-Google-Smtp-Source: AFSGD/UByWem5/i9GvguduTDTwm9oo2zmvEPgfKmXoMcuE+agdXX4gKZwjxi+AWRYMd2BRWh9cDu X-Received: by 2002:a65:5bc4:: with SMTP id o4mr20147468pgr.426.1545234920473; Wed, 19 Dec 2018 07:55:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545234920; cv=none; d=google.com; s=arc-20160816; b=h1ad5x8wbSOWivhs3XD+WE7pSXiVyb7cQJssf/RgCLjJNcGB45w2WBm1BtJDpICmQH hqibOtKoSx6FiBBX0fCo7yi+rkBhsAN8agJen+TXNP1QtLb4KFuKr8sZk/s36Dtj2CEu 2tyXZqB472hJ17FusRjwZVfqeGPNuRNirh33JFFauE1fFKJva4O0xYb6HpN2STDjb4Tl 2rZ7RHI9UHMJyQq7FT25sYPT/FPxKCcT5/Gae67yoiHtKlSHJUFpZLyM035pTn+jdVtx L2zGnrPymiCdCT55WTGRHB6cCIMukyveLuB7V0WtFk06v+y1rW0X0nT1ro0ovxz9x9WB Jzbg== 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=itg6sgbdv5D/o9qyc4SPsYOm5TIDM/YtbxYWW9BQ4BU=; b=tTedww6pN/QdMgiZFQ73Jw1zSLBbUXcbhxPFPvOoKaDMuNtT98VVeKto6M5G09JbJW xDCita+liWSUbF57AuBd7SVqqEDMRVcWoM6LNNeo7LchdsxiK9IdSrPgbzf88JA9mSxK Bj5ST1bogWDbsCGiebZEuKNfIapBAXmGHd5k0etc9l59WJZYCuVJ9IdjUXma0seFsnq0 dWOAE554jAp4fpJZUnFFBUpKBoT4gGGk/sIzl4LG5I9vuGssslEfSXzhlK8Sg4/mu837 VODMOrPJD6ZgdKXivuIVT2/4/F1SBS3nt0rAOwA6zI52l5Kx1KTgJjmsoHJ3xCS9q9pZ wLTw== 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 t136si14700019pfc.262.2018.12.19.07.55.03; Wed, 19 Dec 2018 07:55:20 -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 S1729448AbeLSO0u convert rfc822-to-8bit (ORCPT + 99 others); Wed, 19 Dec 2018 09:26:50 -0500 Received: from mail.bootlin.com ([62.4.15.54]:34961 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729426AbeLSO0t (ORCPT ); Wed, 19 Dec 2018 09:26:49 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 83D91207BE; Wed, 19 Dec 2018 15:26:47 +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, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.2 Received: from xps13 (aaubervilliers-681-1-38-38.w90-88.abo.wanadoo.fr [90.88.157.38]) by mail.bootlin.com (Postfix) with ESMTPSA id 20C372072C; Wed, 19 Dec 2018 15:26:47 +0100 (CET) Date: Wed, 19 Dec 2018 15:26:47 +0100 From: Miquel Raynal To: Naga Sureshkumar Relli Cc: Boris Brezillon , "robh@kernel.org" , "richard@nod.at" , "linux-kernel@vger.kernel.org" , "marek.vasut@gmail.com" , "linux-mtd@lists.infradead.org" , "nagasuresh12@gmail.com" , Michal Simek , "computersforpeace@gmail.com" , "dwmw2@infradead.org" , martin.lund@keep-it-simple.com Subject: Re: [LINUX PATCH v12 3/3] mtd: rawnand: arasan: Add support for Arasan NAND Flash Controller Message-ID: <20181219152647.76f77711@xps13> In-Reply-To: References: <1541739641-17789-1-git-send-email-naga.sureshkumar.relli@xilinx.com> <20181119090246.49060019@bbrezillon> <20181120120244.7d2442b5@bbrezillon> <20181120133624.3fa4742d@xps13> <20181212091135.1d0cc9a6@xps13> <20181212100931.149b0cac@xps13> <20181212141825.69711c57@xps13> <20181217174114.24196d17@xps13> 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 Naga, + Martin Naga Sureshkumar Relli wrote on Tue, 18 Dec 2018 05:33:53 +0000: > Hi Miquel, > > > -----Original Message----- > > From: Miquel Raynal [mailto:miquel.raynal@bootlin.com] > > Sent: Monday, December 17, 2018 10:11 PM > > To: Naga Sureshkumar Relli > > Cc: Boris Brezillon ; robh@kernel.org; richard@nod.at; linux- > > kernel@vger.kernel.org; marek.vasut@gmail.com; linux-mtd@lists.infradead.org; > > nagasuresh12@gmail.com; Michal Simek ; > > computersforpeace@gmail.com; dwmw2@infradead.org > > Subject: Re: [LINUX PATCH v12 3/3] mtd: rawnand: arasan: Add support for Arasan > > NAND Flash Controller > > > > Hi Naga, > > > > [...] > > > > > Inserted biterror @ 48/7 > > > Successfully corrected 25 bit errors per subpage Inserted biterror @ > > > 50/7 ECC failure, invalid data despite read success > > > root@xilinx-zc1751-dc2-2018_1:~# > > > > > > But even in this case also, driver is saying ECC failure but read success. > > > That means controller is able to detect errors on read page up to 24 bit only. > > > After that there is no way to say to the upper layers that the page is bad because of the > > limitation in the controller. > > > > This is more than a "limitation", the design is broken. I am not sure how to support such > > controller, and I am not sure if we even want to. > > The number of errors that are correctable is limited by a parameter 't'(total number of errors), > If there is a condition that the number of errors greater than 't', then the controller won't be able to detect that. > I guess this concept is same for other controllers as well. > In Arasan it is limited to 24-bit. > > Even, in case of Hamming, it is 1-bit error correction and 2-bit error detection. > What will happen if there are multiple errors(greater than 2-bit)? Ok let's use the Hamming comparison in your ECC engine case. -> hamming: * 0 bf: everything is fine * 1 bf: will be detected, corrected, signaled * 2 bf: will be detected, not corrected, signaled * 3+ bf: don't care -> BCH: * 0 bf: everything is fine * 1-24 bf: will be detected, corrected, signaled * 25 bf: everything is fine * 26+ bf: don't care Do you see the problem? In the 25 bf case, the controller is reporting that everything went fine while it should report that it detected an uncorrectable situation. Here are two leads to solve this issue, please investigate them both: 1/ Talk to your colleagues that developed the RTL, ask if there is a hidden/reserved bit for that purpose that is not documented. 2/ Search for a status in the registers that might indicate that an error occurred, for instance "0 bf corrected" and "bf have been detected". NB: I know that, with a BCH ECC engine, error detection at (strength + 1) is not 100% sure but statistically it will almost always be detected and in this case we need the controller to warn the user! Thanks, Miquèl