From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Thu, 26 Jun 2008 11:52:26 -0500 Subject: [U-Boot-Users] [PATCH] mtd: CONFIG_NAND_LAZY_SCAN option support In-Reply-To: <4863664A.4020807@emcraft.com> References: <4863664A.4020807@emcraft.com> Message-ID: <4863C94A.2010602@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Ilya Yanok wrote: > diff --git a/common/cmd_nand.c b/common/cmd_nand.c > index 37eb41b..6f5d13d 100644 > --- a/common/cmd_nand.c > +++ b/common/cmd_nand.c > @@ -236,6 +236,8 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, > char *argv[]) > } > nand = &nand_info[nand_curr_device]; > > + nand_lazy_scan_finish(nand); > + There are other entry points that need to be covered (e.g. do_nandboot, do_onenand, env_nand, jffs2, etc). Probably better to put the call in nand_block_isbad(). > diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c > index 740d3fc..f3ee705 100644 > --- a/drivers/mtd/nand/nand_base.c > +++ b/drivers/mtd/nand/nand_base.c > @@ -2652,8 +2652,13 @@ int nand_scan (struct mtd_info *mtd, int maxchips) > #if 0 > mtd->owner = THIS_MODULE; > #endif > +#ifdef CONFIG_NAND_LAZY_SCAN > + this->options &= ~NAND_BBT_SCANNED; > + return 0; > +#else > /* Build bad block table */ > return this->scan_bbt (mtd); > +#endif Is there any reason not to enable this unconditionally? Also, this patch is whitespace-mangled. -Scott