Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1222002imm; Tue, 22 May 2018 00:05:30 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpU2HPnHBU7gaJunBNnZiFWYbtsW2UZt5FtFd7eBqQV2xf+hxKdGRgA51L3hLWDYxDyJ1jY X-Received: by 2002:a17:902:5309:: with SMTP id b9-v6mr23968149pli.187.1526972730399; Tue, 22 May 2018 00:05:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526972730; cv=none; d=google.com; s=arc-20160816; b=twj1+eVnGfqFI39mOBNn4Jp+E7F6yyxp0s1a2b9Zjqx8GhjqPFDJV8uALxA9UnzEoY 6RaLpPRWlEfDbjkaB10Itj/6i5f0bTDrYnL22F4E803l8pvQccz3O1AM4PEZ+6UzQVz+ d2AWcWwChW/rgDr3x1rlbnOvQfOmZM983ZXbV4gIh7l4PtZ7l5oE4zdPItx42OQ4/kMI KWVWVxeFKGs/vtTzj1NZwaAuIyegxD6YaQcj41bQidBDOCWr+S6t3e3t/jG/Q8F6QKdl KRbxd9UwJeBkBivE4SedM3EQC6Ky9rp7vZiwSJtIaS3IXoM6W8E0sTozmU1aTAKxa71X lTIA== 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:arc-authentication-results; bh=o6QSrEMi66EzGgk1Rfiw/lw3sI4o7cGhmhA63mw4wrk=; b=p+zHEWJhdy44XvDIqD6spkhbDus1geTFAiALF9gYNwAp52YlBzhH76yG2m6cnjZ60u rHnc95JWHESKJ0B9kiyR4s+1bk+V8D26tgAGxIUeuk7Ys66B2SaNQjEHVIpPFYziL6Y1 oOQwgDFSBbEHVB7ZwKNPDQ5uP+YqWK59UUJbG6WghhM8M3cuLwdDU3F0iQrzNupgyuUD KBsQu3U4l0VKe2YqCec/X0UpoalNX+FzLColUxzlm0ugrVH8/zHSu8A8/aLGfMrKw7Dp DmX1veddCocIVpkLn3EUrhSO4/a415hgrmb45o1FU2Y9e5kJUJMI/iZBPRjg91wCKMKj uCWQ== 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 u17-v6si15852286plj.182.2018.05.22.00.05.15; Tue, 22 May 2018 00:05:30 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751240AbeEVHFC convert rfc822-to-8bit (ORCPT + 99 others); Tue, 22 May 2018 03:05:02 -0400 Received: from mail.bootlin.com ([62.4.15.54]:44298 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751106AbeEVHFB (ORCPT ); Tue, 22 May 2018 03:05:01 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 418712072C; Tue, 22 May 2018 09:04:59 +0200 (CEST) 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 shortcircuit=ham autolearn=disabled version=3.4.0 Received: from xps13 (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id D9B782036F; Tue, 22 May 2018 09:04:58 +0200 (CEST) Date: Tue, 22 May 2018 09:04:59 +0200 From: Miquel Raynal To: Abhishek Sahu Cc: Boris Brezillon , David Woodhouse , Brian Norris , Marek Vasut , Richard Weinberger , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Andy Gross , Archit Taneja Subject: Re: [PATCH v2 06/14] mtd: rawnand: qcom: erased page detection for uncorrectable errors only Message-ID: <20180522090459.71d35004@xps13> In-Reply-To: <1525350041-22995-7-git-send-email-absahu@codeaurora.org> References: <1525350041-22995-1-git-send-email-absahu@codeaurora.org> <1525350041-22995-7-git-send-email-absahu@codeaurora.org> Organization: Bootlin X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; 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 Abhishek, On Thu, 3 May 2018 17:50:33 +0530, Abhishek Sahu wrote: > Following is the flow in the HW if controller tries to read erased > page Nit: ^ missing ':' > > 1. First ECC uncorrectable error will be generated from ECC engine > since ECC engine first calculates the ECC with all 0xff and match > the calculated ECC with ECC code in OOB (which is again all 0xff). > 2. After getting ECC error, erased CW detection logic will be > applied which is different for BCH and RS ECC > a. For BCH, HW checks if all the bytes in page are 0xff and then > it updates the status in separate register > NAND_ERASED_CW_DETECT_STATUS. > b. For RS ECC, the HW reports the same error when reading an > erased CW, but it notifies that it is an erased CW by > placing special characters at certain offsets in the > buffer. > > So the erased CW detect status should be checked only if ECC engine > generated the uncorrectable error. > > Currently for all other operational errors also (like TIMEOUT, MPU > errors, etc.), the erased CW detect logic is being applied so fix this > and return EIO for other operational errors. > > Signed-off-by: Abhishek Sahu > --- > * Changes from v1: > > 1. Added more detail in commit message > 2. Added comment before each if/else Thanks for that, it's much more ease to review :) > 3. Removed redundant check for BS_UNCORRECTABLE_BIT > > drivers/mtd/nand/raw/qcom_nandc.c | 65 ++++++++++++++++++++++++++------------- > 1 file changed, 43 insertions(+), 22 deletions(-) > Acked-by: Miquel Raynal Thanks, Miquèl