From patchwork Fri Jul 17 19:32:53 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Brownell X-Patchwork-Id: 29935 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id DB8CEB7066 for ; Sat, 18 Jul 2009 05:36:20 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1MRtB1-0004J9-GZ; Fri, 17 Jul 2009 19:33:03 +0000 Received: from smtp123.sbc.mail.sp1.yahoo.com ([69.147.64.96]) by bombadil.infradead.org with smtp (Exim 4.69 #1 (Red Hat Linux)) id 1MRtAu-0004HW-Ni for linux-mtd@lists.infradead.org; Fri, 17 Jul 2009 19:33:01 +0000 Received: (qmail 55709 invoked from network); 17 Jul 2009 19:32:54 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=pacbell.net; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:From:To:Subject:Date:User-Agent:Cc:References:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-Disposition:Message-Id; b=IpsLXXQ2GU0wR4treXsZVEceBVU9dCRgZq1ervXkdKpBWwRWkSHRxcD6T5G7DQfZ8jShH22T6VosDHhVci+Pd+JTB5+Tt3qhjf/y5Adm/yeCKzwjrVo3hzGiq8x/3WGFWTHOkmcFbJezFRwQUcmpWN4akA4RQ4YwJBXr2wPOSsE= ; Received: from unknown (HELO albert) (david-b@69.226.209.118 with plain) by smtp123.sbc.mail.sp1.yahoo.com with SMTP; 17 Jul 2009 19:32:54 -0000 X-YMail-OSG: c0JsdpsVM1nhv8IjQ67e8LTsbS0zx9dJMPJ3H.xEpkuQh5dJh2NzqeQ_HKSyVuc11gpSADEdK3L.DxTDqwpu.c5D6isbSH8ISCuOj_VK6jHcImNASGM3F7CkPk80XDSXsHXav0IoZ7dWDnI9Pjzrvmtx7b5CPXlbfcHIAM5k7OanWDCyD57XJyo_3Pu7e0w9WUfipbwnLJR0wx4osNYYex3KghjjvfHxNkeWzapHaFaHL7j_J9vm_YLJRVx1BseO67igJqTUrjwK5cSe8S3bGOeUwPMtxFRW_FxQHEwO1YBN1g-- X-Yahoo-Newman-Property: ymail-3 From: David Brownell To: davinci-linux-open-source@linux.davincidsp.com Subject: Re: [PATCH v3 3/3] mtd-nand: DaVinci: Add 4-bit ECC support for large page NAND chips Date: Fri, 17 Jul 2009 12:32:53 -0700 User-Agent: KMail/1.9.10 References: <1247781590-11323-1-git-send-email-nsnehaprabha@ti.com> In-Reply-To: <1247781590-11323-1-git-send-email-nsnehaprabha@ti.com> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200907171232.53725.david-b@pacbell.net> X-Spam-Score: 0.0 (/) Cc: linux-mtd@lists.infradead.org, tglx@linutronix.de, nsnehaprabha@ti.com, dwmw2@infradead.org, akpm@linux-foundation.org X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org On Thursday 16 July 2009, nsnehaprabha@ti.com wrote: > It also fixes a bug in the ECC correction handler. > When we introduce 5 bit-errors in chunk, error correction stops working. When > errors are detected the 4BITECC_START bit was left high, which should be > cleared. Agreed that needs to be fixed, but there should be a comment about this being an *undocumented* behavior in the hardware. The reason that the bug exists at all is because this step has never been documented. So, please roll in this update. - Dave --- drivers/mtd/nand/davinci_nand.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/drivers/mtd/nand/davinci_nand.c +++ b/drivers/mtd/nand/davinci_nand.c @@ -350,13 +350,16 @@ compare: /* * Clear any previous address calculation by doing a dummy read of an - * error address register. + * error address register. UNDOCUMENTED that the ECC engine won't + * recover after 5-bit ECC errors without this step. */ davinci_nand_readl(info, NAND_ERR_ADD1_OFFSET); /* Start address calculation, and wait for it to complete. * We _could_ start reading more data while this is working, - * to speed up the overall page read. + * to speed up the overall page read. UNDOCUMENTED that + * reading some ERRVAL register is needed in all cases, not + * just when an error must be corrected. */ davinci_nand_writel(info, NANDFCR_OFFSET, davinci_nand_readl(info, NANDFCR_OFFSET) | BIT(13));