From patchwork Wed Aug 22 09:27:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Genoud X-Patchwork-Id: 179270 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 EA8332C008A for ; Wed, 22 Aug 2012 19:30:06 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T47F3-0004hp-CB; Wed, 22 Aug 2012 09:28:49 +0000 Received: from mail-wi0-f177.google.com ([209.85.212.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T47Ef-0004YC-Ge for linux-mtd@lists.infradead.org; Wed, 22 Aug 2012 09:28:26 +0000 Received: by wibhn17 with SMTP id hn17so479735wib.0 for ; Wed, 22 Aug 2012 02:28:23 -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=lpoEsDE4abBuC5E0gThMOs9b8CyA80suZGolmOp02bE=; b=asMLXNmlugLGF4J4pIO70dKW4iNuNcJWTcMupigxBhJugV4AuC2cQfY+0h05x0Vi5X JJ8/novb0GEgM9/i9I2UF2w+bi1PyHeqNmb2XviosGUoSfKthb3pNuis7XreMo2T4U1w Vmnl+ncwqXReffTJ6/WjPPNY+kc0zsPs6WssS09ad/TugBj54fulumcisJwBmWAEI0CO e2IDnFPsig50uOKsfEglnyKOPOGAhKQNhInO/HaUeP3JZ05GPYGxjnQvivZquUf0W6+n sgseM/L+o9GhjrIY6RtlgQWIgf8VriEtEDSTH2rNrT8fUvSBtZAWWoX9ppCZN2o7nkwz 4ziw== Received: by 10.216.132.76 with SMTP id n54mr10549570wei.135.1345627703575; Wed, 22 Aug 2012 02:28:23 -0700 (PDT) Received: from localhost.localdomain (lyon.paratronic.fr. [213.41.177.106]) by mx.google.com with ESMTPS id bc2sm11291782wib.0.2012.08.22.02.28.22 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 22 Aug 2012 02:28:23 -0700 (PDT) From: Richard Genoud To: Artem Bityutskiy Subject: [PATCH MTD-UTILS 4/5] sync include/mtd/ubi-user.h: add max_beb_per1024 parameter Date: Wed, 22 Aug 2012 11:27:59 +0200 Message-Id: <1345627680-8166-5-git-send-email-richard.genoud@gmail.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1345627680-8166-1-git-send-email-richard.genoud@gmail.com> References: <1345627680-8166-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.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (richard.genoud[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.177 listed in list.dnswl.org] -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 Signed-off-by: Richard Genoud --- include/mtd/ubi-user.h | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git a/include/mtd/ubi-user.h b/include/mtd/ubi-user.h index 123951f..a12c884 100644 --- a/include/mtd/ubi-user.h +++ b/include/mtd/ubi-user.h @@ -222,6 +222,7 @@ enum { * @ubi_num: UBI device number to create * @mtd_num: MTD device number to attach * @vid_hdr_offset: VID header offset (use defaults if %0) + * @max_beb_per1024: maximum expected number of bad PEB per 1024 PEBs * @padding: reserved for future, not used, has to be zeroed * * This data structure is used to specify MTD device UBI has to attach and the @@ -245,12 +246,25 @@ enum { * be 2KiB-64 bytes = 1984. Note, that this position is not even 512-bytes * aligned, which is OK, as UBI is clever enough to realize this is 4th * sub-page of the first page and add needed padding. + * + * The @max_beb_per1024 is the maximum amount of bad PEBs UBI expects on the + * UBI device per 1024 eraseblocks. This value is often given in an other form + * in the NAND datasheet (min NVB i.e. minimal number of valid blocks). The + * maximum expected bad eraseblocks per 1024 is then: + * 1024 * (1 - MinNVB / MaxNVB) + * Which gives 20 for most NAND devices. This limit is used in order to derive + * amount of eraseblock UBI reserves for handling new bad blocks. If the device + * has more bad eraseblocks than this limit, UBI does not reserve any physical + * eraseblocks for new bad eraseblocks, but attempts to use available + * eraseblocks (if any). The accepted range is 0-768. If 0 is given, the + * default kernel value of %CONFIG_MTD_UBI_BEB_LIMIT will be used. */ struct ubi_attach_req { __s32 ubi_num; __s32 mtd_num; __s32 vid_hdr_offset; - __s8 padding[12]; + __s16 max_beb_per1024; + __s8 padding[10]; }; /**