Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1639834imm; Tue, 22 May 2018 07:11:22 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpu1reGVNk/2isWUyfk4keYkSVm3mKeTLhvxjGZ/V+JvvOdrw0+xrzH2Pjx8oydsgYp3Uyp X-Received: by 2002:a62:c050:: with SMTP id x77-v6mr24397571pff.67.1526998282316; Tue, 22 May 2018 07:11:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526998282; cv=none; d=google.com; s=arc-20160816; b=HKlMZsQ/HJwemRPIKsAhXLBM+VIY5ALK0fzRpGGYz2qIc/o84FbU+r7O8/6glWuU2d 3k8+SiP2r6UfecRhn5u/uDL+jhXE8Ku3UXVfikvMYl8q3l/rBzTYCpV8KOJ6vAR/4Z+Q 7dDSit5luNyQBnovgB7QHCjIPovvIzSjT1KWli/q2Q2hqJib2qKZl8CwQ5jv6/gVWd3v Hb8A9L83GK+b60h4K3kBoLFc7WgnvKPyxE+NQA4E1qRtZD9bf9VoS2xzAJQybAmt8PpX /8f417JIzrI5AMlx0QPhKTnrDBGV9YP6D0HLoxYVrZ4FtbYE/0O2kRO0/JWDrLaLyNna pBsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=WKq4+WmLg+cQ1pgvXkPAu81Sb1xEjt8xiRdAJxWLEO4=; b=o8LJ2jqjq7TRwkmijJEkCVIsFVZ05IqpAhGWBX+EuJBQAfl05VVrjz+NxVuGSsTqul wkeVLFKuVs9OcqhxLsMaZ6eVAtvmaBXBpV/W3z+FrE/ekfsMWXJQfTRMFJGUn7zncSVl i2ssEBi71472p2dznsIrgj1UXUm7SbhbEaHfllh1H1PUVjMAjCvc2omNIMBWnzahopGA 9BYNwTVwyFBtNJY0lLAyPU5ApjdBVKlotCPBRC3nXCi1njyz4myodO413RqRNXiJYzqT fpy6I3v2l/MlB6Ijgsb9YrkC5qDRYMZ5GVlGSqaeEzbRzu1xuC4mqIRwDLJge8rBVGGT x6Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=IhpyhG4y; dkim=pass header.i=@codeaurora.org header.s=default header.b=PkL3Nihl; 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 h8-v6si17189297pls.502.2018.05.22.07.11.06; Tue, 22 May 2018 07:11:22 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=IhpyhG4y; dkim=pass header.i=@codeaurora.org header.s=default header.b=PkL3Nihl; 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 S1751844AbeEVOKZ (ORCPT + 99 others); Tue, 22 May 2018 10:10:25 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:43490 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751173AbeEVOKX (ORCPT ); Tue, 22 May 2018 10:10:23 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8E30160AD4; Tue, 22 May 2018 14:10:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526998222; bh=KJMID/YprqfxK2FCBp2nlYeLmvlNBGB8EvEpRJjLrss=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IhpyhG4ypemPLrO8JvXhX8cpO7yDX0KMR68Hb//xWywGQ4yvsRX/KsSzgIm7JCQtf 3aD+6Fo7hk11nWAu2vnMFye6BgNccZ1fhbGtEzCR4S1NUX1NW8W0UJKJfgSz5mc+YC UIaLbDngjKx3KVqC7I36gyfw048OXnFaCezRoGyY= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 9390660314; Tue, 22 May 2018 14:10:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526998221; bh=KJMID/YprqfxK2FCBp2nlYeLmvlNBGB8EvEpRJjLrss=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=PkL3NihllRbsC7K0uCWa8oyELDK+T9uBGKxmw+OzNM9oa2z4hV7088VGL6bT1yu0O zLksmGkexFFAzDyaSaW6yjLRipvsryxQ7qR5G5iK0254mfjkzjMMBYaAtNM3yrUQ5f jTPtcY3bgZ4lPzkD6FEzbiVh9Vhj/oIMGG4nb+KU= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Tue, 22 May 2018 19:40:21 +0530 From: Abhishek Sahu To: Miquel Raynal 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 In-Reply-To: <20180522090459.71d35004@xps13> References: <1525350041-22995-1-git-send-email-absahu@codeaurora.org> <1525350041-22995-7-git-send-email-absahu@codeaurora.org> <20180522090459.71d35004@xps13> Message-ID: <6368d5f14b40626bd590f6eda8cf1bcd@codeaurora.org> X-Sender: absahu@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-05-22 12:34, Miquel Raynal wrote: > 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 ':' > Sure. I will fix this. >> >> 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 :) Thanks Miquel for your review. Regards, Abhishek > >> 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