From patchwork Sun Mar 11 21:21:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Dunn X-Patchwork-Id: 146280 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 5C0C1B6FB7 for ; Tue, 13 Mar 2012 10:00:38 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1S7EDQ-0006LL-B2; Mon, 12 Mar 2012 22:59:44 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1S7Boo-0003Ks-26 for linux-mtd@merlin.infradead.org; Mon, 12 Mar 2012 20:26:10 +0000 Received: from smtp.newsguy.com ([74.209.136.69]) by casper.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1S6rA2-0003V0-Sz for linux-mtd@lists.infradead.org; Sun, 11 Mar 2012 22:22:45 +0000 Received: from localhost.localdomain (77.sub-166-250-2.myvzw.com [166.250.2.77]) by smtp.newsguy.com (8.14.3/8.14.3) with ESMTP id q2BMLdlH067897 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 11 Mar 2012 15:21:58 -0700 (PDT) (envelope-from mikedunn@newsguy.com) From: Mike Dunn To: linux-mtd@lists.infradead.org Subject: [PATCH 1/4] MTD: add ecc_strength fields to mtd structs Date: Sun, 11 Mar 2012 14:21:10 -0700 Message-Id: <1331500873-9792-2-git-send-email-mikedunn@newsguy.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1331500873-9792-1-git-send-email-mikedunn@newsguy.com> References: <1331500873-9792-1-git-send-email-mikedunn@newsguy.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20120311_222243_284638_DEA5BE7B X-CRM114-Status: GOOD ( 12.67 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Mike Dunn 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 adds 'ecc_strength' to struct mtd_info. This stores the maximum number of bit errors that can be corrected in one writesize region. For consistency with the nand code, 'strength' is similiarly added to struct nand_ecc_ctrl. This stores the maximum number of bit errors that can be corrected in one ecc step. Signed-off-by: Mike Dunn --- include/linux/mtd/mtd.h | 3 +++ include/linux/mtd/nand.h | 2 ++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 726c2d1..cf5ea8c 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -164,6 +164,9 @@ struct mtd_info { /* ECC layout structure pointer - read only! */ struct nand_ecclayout *ecclayout; + /* max number of correctible bit errors per writesize */ + unsigned int ecc_strength; + /* Data for variable erase regions. If numeraseregions is zero, * it means that the whole device has erasesize as given above. */ diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 609868f..1482340 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -324,6 +324,7 @@ struct nand_hw_control { * @steps: number of ECC steps per page * @size: data bytes per ECC step * @bytes: ECC bytes per step + * @strength: max number of correctible bits per ECC step * @total: total number of ECC bytes per page * @prepad: padding information for syndrome based ECC generators * @postpad: padding information for syndrome based ECC generators @@ -351,6 +352,7 @@ struct nand_ecc_ctrl { int size; int bytes; int total; + int strength; int prepad; int postpad; struct nand_ecclayout *layout;