From patchwork Wed Apr 27 12:09:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Saxena, Parth" X-Patchwork-Id: 93035 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 86CA5B6EF2 for ; Wed, 27 Apr 2011 22:11:29 +1000 (EST) Received: from canuck.infradead.org ([2001:4978:20e::1]) by bombadil.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1QF3Yq-0004AG-6v; Wed, 27 Apr 2011 12:09:40 +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 1QF3Yn-0002wY-ET; Wed, 27 Apr 2011 12:09:37 +0000 Received: from arroyo.ext.ti.com ([192.94.94.40]) by canuck.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1QF3Yg-0002wF-Cu for linux-mtd@lists.infradead.org; Wed, 27 Apr 2011 12:09:34 +0000 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id p3RC9PEJ018207 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 27 Apr 2011 07:09:27 -0500 Received: from dbde71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id p3RC9NJ2029502; Wed, 27 Apr 2011 17:39:24 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 8.3.106.1; Wed, 27 Apr 2011 17:39:02 +0530 Received: from psplinux052.india.ti.com (psplinux052.india.ti.com [172.24.162.245]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p3RC9Lsb008475; Wed, 27 Apr 2011 17:39:22 +0530 (IST) Received: from psplinux052.india.ti.com (localhost [127.0.0.1]) by psplinux052.india.ti.com (8.13.1/8.13.1) with ESMTP id p3RC9Lft024264; Wed, 27 Apr 2011 17:39:21 +0530 Received: (from a0131646@localhost) by psplinux052.india.ti.com (8.13.1/8.13.1/Submit) id p3RC9Lbm024255; Wed, 27 Apr 2011 17:39:21 +0530 From: "Saxena, Parth" To: Subject: [RFC] mtd: nand: Fix bad block identification issue Date: Wed, 27 Apr 2011 17:39:21 +0530 Message-ID: <1303906161-24175-1-git-send-email-parth.saxena@ti.com> X-Mailer: git-send-email 1.6.2.4 MIME-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110427_080930_594557_29047173 X-CRM114-Status: GOOD ( 11.93 ) 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 [192.94.94.40 listed in list.dnswl.org] Cc: "Basheer, Mansoor Ahamed" , "Saxena, Parth" , linux-omap@vger.kernel.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 Commit e0b58d0 ("mtd: nand: add ->badblockbits for minimum number of set bits in bad block byte") by Maxim Levitsky added badblockbits to nand_chip to specify minimum number of set bits in bad block byte. The patch initialized badblockbits to 8 in nand_base.c, but later the initialization line got removed by commit c7b28e2("mtd: nand: refactor BB marker detection"). After this all NAND drivers with NAND_SKIP_BBTSCAN are forced to initialize it to 8. Otherwise bad block identification will fail. As a result, mounting of empty jffs2 file system on omap3evm (having bad blocks) failed giving the following error message - "mount: mounting /dev/mtdblock4 on /tmp failed: Input/output error" This patch solves the above issue for omap by initialising badblockbits. We are working further on this to find a generic fix to the problem in nand_base.c. Signed-off-by: Saxena, Parth Signed-off-by: Basheer, Mansoor Ahamed --- drivers/mtd/nand/omap2.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index 454f90c..350c77f 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c @@ -1005,6 +1005,8 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) info->nand.options = pdata->devsize; info->nand.options |= NAND_SKIP_BBTSCAN; + info->nand.badblockbits = 8; + /* NAND write protect off */ gpmc_cs_configure(info->gpmc_cs, GPMC_CONFIG_WP, 0);