From patchwork Mon Feb 13 21:55:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Wood X-Patchwork-Id: 141006 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 E4E9AB6FCF for ; Tue, 14 Feb 2012 08:55:58 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2AA2F2805F; Mon, 13 Feb 2012 22:55:57 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 6L58YlLPfTPt; Mon, 13 Feb 2012 22:55:56 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A5CA328082; Mon, 13 Feb 2012 22:55:54 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2275A28082 for ; Mon, 13 Feb 2012 22:55:52 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 yuou27pitB4G for ; Mon, 13 Feb 2012 22:55:51 +0100 (CET) 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 ch1outboundpool.messaging.microsoft.com (ch1ehsobe004.messaging.microsoft.com [216.32.181.184]) by theia.denx.de (Postfix) with ESMTPS id 9EE872805F for ; Mon, 13 Feb 2012 22:55:49 +0100 (CET) Received: from mail52-ch1-R.bigfish.com (10.43.68.231) by CH1EHSOBE006.bigfish.com (10.43.70.56) with Microsoft SMTP Server id 14.1.225.23; Mon, 13 Feb 2012 21:55:45 +0000 Received: from mail52-ch1 (localhost [127.0.0.1]) by mail52-ch1-R.bigfish.com (Postfix) with ESMTP id CE4793E037A; Mon, 13 Feb 2012 21:55:44 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bh8275dhz2dh2a8h668h839h944h) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail52-ch1 (localhost.localdomain [127.0.0.1]) by mail52-ch1 (MessageSwitch) id 1329170142726805_11498; Mon, 13 Feb 2012 21:55:42 +0000 (UTC) Received: from CH1EHSMHS019.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.250]) by mail52-ch1.bigfish.com (Postfix) with ESMTP id A353F2C004B; Mon, 13 Feb 2012 21:55:42 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS019.bigfish.com (10.43.70.19) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 13 Feb 2012 21:55:42 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server (TLS) id 14.1.355.3; Mon, 13 Feb 2012 15:55:43 -0600 Received: from schlenkerla.am.freescale.net (schlenkerla.am.freescale.net [10.82.121.12]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id q1DLtdf6019547; Mon, 13 Feb 2012 14:55:41 -0700 Date: Mon, 13 Feb 2012 15:55:39 -0600 From: Scott Wood To: Message-ID: <20120213215539.GA7541@schlenkerla.am.freescale.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-OriginatorOrg: freescale.com Cc: Thomas Weber Subject: [U-Boot] [PATCH] Revert "nand: make 1-bit software ECC configurable" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This reverts commit 4fee6c2f295f932b8febdc7ce8731ba045695fa5. It breaks boards that currently rely on soft-ecc, as pointed out here: http://patchwork.ozlabs.org/patch/140872/ The reverted patch should be resubmitted with documentation, and with the CONFIG_MTD_ECC_SOFT selected from every board that needs it. We could start by looking at what NAND driver the board selects, and whether that driver ever asks for soft ECC. Signed-off-by: Scott Wood --- drivers/mtd/nand/Makefile | 2 +- drivers/mtd/nand/nand_base.c | 4 ---- include/linux/mtd/nand_ecc.h | 25 ------------------------- 3 files changed, 1 insertions(+), 30 deletions(-) diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile index 998fc73..1d1b628 100644 --- a/drivers/mtd/nand/Makefile +++ b/drivers/mtd/nand/Makefile @@ -39,7 +39,7 @@ COBJS-y += nand_bbt.o COBJS-y += nand_ids.o COBJS-y += nand_util.o endif -COBJS-$(CONFIG_MTD_ECC_SOFT) += nand_ecc.o +COBJS-y += nand_ecc.o COBJS-y += nand_base.o COBJS-$(CONFIG_NAND_ECC_BCH) += nand_bch.o diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 12b960f..8ab8303 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -3028,10 +3028,6 @@ int nand_scan_tail(struct mtd_info *mtd) chip->ecc.mode = NAND_ECC_SOFT; case NAND_ECC_SOFT: - if (!mtd_nand_has_ecc_soft()) { - printk(KERN_WARNING "CONFIG_MTD_ECC_SOFT not enabled\n"); - return -EINVAL; - } chip->ecc.calculate = nand_calculate_ecc; chip->ecc.correct = nand_correct_data; chip->ecc.read_page = nand_read_page_swecc; diff --git a/include/linux/mtd/nand_ecc.h b/include/linux/mtd/nand_ecc.h index 9715a53..090da50 100644 --- a/include/linux/mtd/nand_ecc.h +++ b/include/linux/mtd/nand_ecc.h @@ -15,10 +15,6 @@ struct mtd_info; -#if defined(CONFIG_MTD_ECC_SOFT) - -static inline int mtd_nand_has_ecc_soft(void) { return 1; } - /* * Calculate 3 byte ECC code for 256 byte block */ @@ -29,25 +25,4 @@ int nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code */ int nand_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc); -#else - -static inline int mtd_nand_has_ecc_soft(void) { return 0; } - -static inline int -nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code) -{ - return -1; -} - -static inline int -nand_correct_data(struct mtd_info *mtd, - u_char *dat, - u_char *read_ecc, - u_char *calc_ecc) -{ - return -1; -} - -#endif - #endif /* __MTD_NAND_ECC_H__ */