From patchwork Mon Mar 14 01:50:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Ruirui X-Patchwork-Id: 86654 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 ozlabs.org (Postfix) with ESMTPS id 809B6B6F7D for ; Mon, 14 Mar 2011 12:44:57 +1100 (EST) Received: from canuck.infradead.org ([134.117.69.58]) by bombadil.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1Pywnf-0001j2-87; Mon, 14 Mar 2011 01:42:23 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1Pywne-00050D-HJ; Mon, 14 Mar 2011 01:42:22 +0000 Received: from ebb06.tieto.com ([131.207.168.38]) by canuck.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1Pywms-0004zv-Ek for linux-mtd@lists.infradead.org; Mon, 14 Mar 2011 01:41:36 +0000 X-AuditID: 83cfa826-b7c18ae00000543e-d5-4d7d72354f48 Received: from FIVLA-EXHUB02.eu.tieto.com ( [131.207.136.42]) by ebb06.tieto.com (SMTP Mailer) with SMTP id 5C.66.21566.5327D7D4; Mon, 14 Mar 2011 03:41:09 +0200 (EET) Received: from localhost (10.126.38.218) by inbound.tieto.com (131.207.136.49) with Microsoft SMTP Server id 8.3.106.1; Mon, 14 Mar 2011 03:41:07 +0200 Date: Mon, 14 Mar 2011 09:50:56 +0800 From: Yang Ruirui To: , , , , , Subject: [PATCH 01/02] mtdswap: kill strip error handling option Message-ID: <20110314015056.GA6819@darkstar> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: AAAAAA== X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110313_214134_679013_5CC7DB0E X-CRM114-Status: UNSURE ( 6.64 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [131.207.168.38 listed in list.dnswl.org] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 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 From: Yang Ruirui As Artem Bityutskiy's suggestion, The strict erase error handling option does not make much sense. Here kill the option, and still keep the retry times as before. Signed-off-by: Yang Ruirui --- drivers/mtd/Kconfig | 8 -------- drivers/mtd/mtdswap.c | 8 +------- 2 files changed, 1 insertion(+), 15 deletions(-) --- mtd-2.6-fc2ff59.orig/drivers/mtd/mtdswap.c 2011-03-12 01:49:31.000000000 +0800 +++ mtd-2.6-fc2ff59/drivers/mtd/mtdswap.c 2011-03-14 09:36:09.283329099 +0800 @@ -156,12 +156,6 @@ struct mtdswap_oobdata { #define MTDSWAP_ERASE_RETRIES 3 /* Before marking erase block bad */ #define MTDSWAP_IO_RETRIES 3 -#ifdef CONFIG_MTD_SWAP_STRICT -#define MTDSWAP_STRICT 1 -#else -#define MTDSWAP_STRICT 0 -#endif - enum { MTDSWAP_SCANNED_CLEAN, MTDSWAP_SCANNED_DIRTY, @@ -575,7 +569,7 @@ retry: ret = mtd->erase(mtd, &erase); if (ret) { - if (retries++ < MTDSWAP_ERASE_RETRIES && !MTDSWAP_STRICT) { + if (retries++ < MTDSWAP_ERASE_RETRIES) { dev_warn(d->dev, "erase of erase block %#llx on %s failed", erase.addr, mtd->name); --- mtd-2.6-fc2ff59.orig/drivers/mtd/Kconfig 2011-03-12 01:49:31.000000000 +0800 +++ mtd-2.6-fc2ff59/drivers/mtd/Kconfig 2011-03-14 09:36:45.269995898 +0800 @@ -335,14 +335,6 @@ config MTD_SWAP The driver provides wear leveling by storing erase counter into the OOB. -config MTD_SWAP_STRICT - bool "Strict erase error handling" - depends on MTD_SWAP - help - Enables strict tolerance on failed erasures, marking erase blocks bad - right after the first failed operation. With non-strict mode the - erase operation is retried. - source "drivers/mtd/chips/Kconfig" source "drivers/mtd/maps/Kconfig"