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: 735641 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3RCfO6F007265 for ; Wed, 27 Apr 2011 12:51:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758618Ab1D0MJf (ORCPT ); Wed, 27 Apr 2011 08:09:35 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:43284 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755561Ab1D0MJf (ORCPT ); Wed, 27 Apr 2011 08:09:35 -0400 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: CC: , "Saxena, Parth" , "Basheer, Mansoor Ahamed" 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 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 27 Apr 2011 12:51:46 +0000 (UTC) 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 Tested-By: Saxena, Parth Acked-by: Brian Norris --- 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);