From patchwork Mon Aug 20 16:00:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Genoud X-Patchwork-Id: 178870 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 806FA2C007E for ; Tue, 21 Aug 2012 02:02:32 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T3UPe-0007Bm-Rt; Mon, 20 Aug 2012 16:01:11 +0000 Received: from mail-wg0-f49.google.com ([74.125.82.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T3UP9-00070h-2H for linux-mtd@lists.infradead.org; Mon, 20 Aug 2012 16:00:41 +0000 Received: by wgbez12 with SMTP id ez12so3955841wgb.18 for ; Mon, 20 Aug 2012 09:00:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=AtBqkz7lipPhNwR7y53Ra75ZFXmgLupCuAaC3v6z+hI=; b=ruA7OAl0PUIqisE5fhbRfFZfnQVzVupRLbRWAnh0dv/18F551A/n0LZcqKowanKnaA kpYtr0/23x7mwmi7MfXlX5AQGlszdLfG5joR8NNAbg83p4iEtBVEmxG1xgtc5JsrR+ia c1kLGl4Ucu0JSxcjOLs0+luxQvWsgvTfkYc3KEjWDrozVgofNr2neg19Mt/Z5wpfX7Mm k6fN2EPfr2DKz5ZYSEcUA0FzL96VDddWZ41GqW3xE93wB7oMcaRAVNrdhdvZ+yl7EFge vVDGquPmjfCIyFnEBawgoPZG8iYdPILKV1i4wizvC312752l1Fw1Zr/0TzryhbbGWl1y sa9Q== Received: by 10.180.76.36 with SMTP id h4mr28855600wiw.13.1345478437435; Mon, 20 Aug 2012 09:00:37 -0700 (PDT) Received: from localhost.localdomain (lyon.paratronic.fr. [213.41.177.106]) by mx.google.com with ESMTPS id ef5sm42489198wib.3.2012.08.20.09.00.36 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 20 Aug 2012 09:00:36 -0700 (PDT) From: Richard Genoud To: Artem Bityutskiy Subject: [PATCH v3 6/6] UBI: drop CONFIG_MTD_UBI_BEB_LIMIT Date: Mon, 20 Aug 2012 18:00:16 +0200 Message-Id: <1345478416-23900-7-git-send-email-richard.genoud@gmail.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1345478416-23900-1-git-send-email-richard.genoud@gmail.com> References: <1345478416-23900-1-git-send-email-richard.genoud@gmail.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (richard.genoud[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Richard Genoud , linux-mtd@lists.infradead.org, Shmulik Ladkani X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This option can be set by a kernel parameter and an ioctl, so we may not need the kernel config option any more. Signed-off-by: Richard Genoud --- arch/arm/configs/sam9_l9260_defconfig | 1 - drivers/mtd/ubi/Kconfig | 29 ----------------------------- drivers/mtd/ubi/build.c | 4 ++-- drivers/mtd/ubi/ubi.h | 3 +++ 4 files changed, 5 insertions(+), 32 deletions(-) diff --git a/arch/arm/configs/sam9_l9260_defconfig b/arch/arm/configs/sam9_l9260_defconfig index b4384af..47dd71a 100644 --- a/arch/arm/configs/sam9_l9260_defconfig +++ b/arch/arm/configs/sam9_l9260_defconfig @@ -39,7 +39,6 @@ CONFIG_MTD_NAND=y CONFIG_MTD_NAND_ATMEL=y CONFIG_MTD_NAND_PLATFORM=y CONFIG_MTD_UBI=y -CONFIG_MTD_UBI_BEB_LIMIT=25 CONFIG_MTD_UBI_GLUEBI=y CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_RAM=y diff --git a/drivers/mtd/ubi/Kconfig b/drivers/mtd/ubi/Kconfig index 9406d26..7a57cc0 100644 --- a/drivers/mtd/ubi/Kconfig +++ b/drivers/mtd/ubi/Kconfig @@ -27,35 +27,6 @@ config MTD_UBI_WL_THRESHOLD life-cycle less than 10000, the threshold should be lessened (e.g., to 128 or 256, although it does not have to be power of 2). -config MTD_UBI_BEB_LIMIT - int "Maximum expected bad eraseblock count per 1024 eraseblocks" - default 20 - range 0 768 - help - This option specifies the maximum bad physical eraseblocks UBI - expects on the MTD device (per 1024 eraseblocks). If the underlying - flash does not admit of bad eraseblocks (e.g. NOR flash), this value - is ignored. - - NAND datasheets often specify the minimum and maximum NVM (Number of - Valid Blocks) for the flashes' endurance lifetime. The maximum - expected bad eraseblocks per 1024 eraseblocks then can be calculated - as "1024 * (1 - MinNVB / MaxNVB)", which gives 20 for most NANDs - (MaxNVB is basically the total count of eraseblocks on the chip). - - To put it differently, if this value is 20, UBI will try to reserve - about 1.9% of physical eraseblocks for bad blocks handling. And that - will be 1.9% of eraseblocks on the entire NAND chip, not just the MTD - partition UBI attaches. This means that if you have, say, a NAND - flash chip admits maximum 40 bad eraseblocks, and it is split on two - MTD partitions of the same size, UBI will reserve 40 eraseblocks when - attaching a partition. - - This option can be overridden by the kernel parameter ubi.mtd and the - ioctl UBI_IOCATT. - - Leave the default value if unsure. - config MTD_UBI_GLUEBI tristate "MTD devices emulation driver (gluebi)" help diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index a690d86..b0adc58 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -869,7 +869,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, * ioctl and the module parameter. */ if (!max_beb_per1024) - max_beb_per1024 = CONFIG_MTD_UBI_BEB_LIMIT; + max_beb_per1024 = MTD_UBI_DEFAULT_BEB_LIMIT; /* * Check if we already have the same MTD device attached. @@ -1415,7 +1415,7 @@ MODULE_PARM_DESC(mtd, "MTD devices to attach. Parameter format: mtd=