From patchwork Wed Apr 8 14:44:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 459304 X-Patchwork-Delegate: scottwood@freescale.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 67BA91401AD for ; Thu, 9 Apr 2015 00:45:59 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=agner.ch header.i=@agner.ch header.b=EaT+frlt; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CA2A0A749B; Wed, 8 Apr 2015 16:45:39 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7Q9SGe8mDPwd; Wed, 8 Apr 2015 16:45:39 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 54989A7439; Wed, 8 Apr 2015 16:45:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5AB1BA7429 for ; Wed, 8 Apr 2015 16:44:52 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0kY_h5kL7s0Y for ; Wed, 8 Apr 2015 16:44:52 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail.kmu-office.ch (mail.kmu-office.ch [178.209.48.109]) by theia.denx.de (Postfix) with ESMTP id 500FDA7427 for ; Wed, 8 Apr 2015 16:44:46 +0200 (CEST) Received: from trochilidae.toradex.int (unknown [46.140.72.82]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 915565C0E4D; Wed, 8 Apr 2015 16:43:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=agner.ch; s=dkim; t=1428504232; bh=7YO+aGyxIjwvRVlIm433CdseDRm5uVHbbNCUZqE4vcg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EaT+frlt4dOnnBvoksZ9JSzDnsP9CTLrngQRZDDej+vvgkDEg8pbNviC7M+I1LBQJ lrsLoW0IGVMy5LwsEsan6letsM6Z3LJJbkIDtZkDF8xX6RIKBbv7gcQNYkmCyJSfgv p1XcepUglDB5L8hxEGNEEOSQKXIZ91VCHRT+kHUw= From: Stefan Agner To: scottwood@freescale.com, trini@konsulko.com Date: Wed, 8 Apr 2015 16:44:36 +0200 Message-Id: <1428504281-30214-4-git-send-email-stefan@agner.ch> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1428504281-30214-1-git-send-email-stefan@agner.ch> References: <1428504281-30214-1-git-send-email-stefan@agner.ch> Cc: u-boot@lists.denx.de, bpringlemeir@nbsps.com Subject: [U-Boot] [PATCH v2 3/8] mtd: vf610_nfc: allow bitflips in an empty page X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Allow bit flips in a empty page up to half of the recoverable bits (strength / 2). Signed-off-by: Stefan Agner --- drivers/mtd/nand/vf610_nfc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c index 66b335d..16485f5 100644 --- a/drivers/mtd/nand/vf610_nfc.c +++ b/drivers/mtd/nand/vf610_nfc.c @@ -527,7 +527,7 @@ static inline int vf610_nfc_correct_data(struct mtd_info *mtd, u_char *dat) flip = count_written_bits(dat, nfc->chip.ecc.size, ecc_count); /* ECC failed. */ - if (flip > ecc_count) + if (flip > ecc_count && flip > (nfc->chip.ecc.strength / 2)) return -1; /* Erased page. */