From patchwork Tue Sep 27 18:54:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Wood X-Patchwork-Id: 116652 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id B9161B6F68 for ; Wed, 28 Sep 2011 04:58:16 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 920B0283D7; Tue, 27 Sep 2011 20:58:13 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8TZh5IsChRCw; Tue, 27 Sep 2011 20:58:12 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 94A7E2836F; Tue, 27 Sep 2011 20:58:10 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 76B8C2836F for ; Tue, 27 Sep 2011 20:58:08 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q6X56K9KWsB9 for ; Tue, 27 Sep 2011 20:58:07 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from TX2EHSOBE003.bigfish.com (tx2ehsobe002.messaging.microsoft.com [65.55.88.12]) by theia.denx.de (Postfix) with ESMTPS id 0D11A28365 for ; Tue, 27 Sep 2011 20:58:05 +0200 (CEST) Received: from mail22-tx2-R.bigfish.com (10.9.14.250) by TX2EHSOBE003.bigfish.com (10.9.40.23) with Microsoft SMTP Server id 14.1.225.22; Tue, 27 Sep 2011 18:58:04 +0000 Received: from mail22-tx2 (localhost.localdomain [127.0.0.1]) by mail22-tx2-R.bigfish.com (Postfix) with ESMTP id 29A8F1B58300; Tue, 27 Sep 2011 18:58:04 +0000 (UTC) X-SpamScore: -9 X-BigFish: VS-9(zz1432N98dKzz1202hzz8275bhz2dh2a8h668h839h944h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail22-tx2 (localhost.localdomain [127.0.0.1]) by mail22-tx2 (MessageSwitch) id 1317149820466760_23755; Tue, 27 Sep 2011 18:57:00 +0000 (UTC) Received: from TX2EHSMHS037.bigfish.com (unknown [10.9.14.244]) by mail22-tx2.bigfish.com (Postfix) with ESMTP id B81181C401AB; Tue, 27 Sep 2011 18:54:12 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by TX2EHSMHS037.bigfish.com (10.9.99.137) with Microsoft SMTP Server (TLS) id 14.1.225.22; Tue, 27 Sep 2011 18:54:09 +0000 Received: from az33smr02.freescale.net (10.64.34.200) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server id 14.1.323.7; Tue, 27 Sep 2011 13:54:09 -0500 Received: from schlenkerla.am.freescale.net (schlenkerla.am.freescale.net [10.82.121.12]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id p8RIs8BL013917; Tue, 27 Sep 2011 13:54:08 -0500 (CDT) Date: Tue, 27 Sep 2011 13:54:08 -0500 From: Scott Wood To: Marek Vasut Message-ID: <20110927185407.GA10082@schlenkerla.am.freescale.net> References: <1315800250-19761-1-git-send-email-marek.vasut@gmail.com> <1315800250-19761-2-git-send-email-marek.vasut@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1315800250-19761-2-git-send-email-marek.vasut@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-OriginatorOrg: freescale.com Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH 1/5] NAND: Really ignore bad blocks when scrubbing X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de On Mon, Sep 12, 2011 at 06:04:06AM +0200, Marek Vasut wrote: > Signed-off-by: Marek Vasut > Cc: Scott Wood > Cc: Stefano Babic > Cc: Wolfgang Denk > Cc: Detlev Zundel > --- > drivers/mtd/nand/nand_base.c | 2 +- > drivers/mtd/nand/nand_util.c | 22 +++++----------------- > include/linux/mtd/mtd.h | 1 + > 3 files changed, 7 insertions(+), 18 deletions(-) Applied to u-boot-nand-flash next with this change to remove the chip/priv_nand redundancy: -Scott diff --git a/drivers/mtd/nand/nand_util.c b/drivers/mtd/nand/nand_util.c index 0c3b7f7..60c778e 100644 --- a/drivers/mtd/nand/nand_util.c +++ b/drivers/mtd/nand/nand_util.c @@ -79,7 +79,6 @@ int nand_erase_opts(nand_info_t *meminfo, const nand_erase_options_t *opts) const char *mtd_device = meminfo->name; struct mtd_oob_ops oob_opts; struct nand_chip *chip = meminfo->priv; - struct nand_chip *priv_nand = meminfo->priv; if ((opts->offset & (meminfo->writesize - 1)) != 0) { printf("Attempt to erase non page aligned data\n"); @@ -109,10 +108,10 @@ int nand_erase_opts(nand_info_t *meminfo, const nand_erase_options_t *opts) * We don't need the bad block table anymore... * after scrub, there are no bad blocks left! */ - if (priv_nand->bbt) { - kfree(priv_nand->bbt); + if (chip->bbt) { + kfree(chip->bbt); } - priv_nand->bbt = NULL; + chip->bbt = NULL; } for (erased_length = 0; @@ -197,7 +196,7 @@ int nand_erase_opts(nand_info_t *meminfo, const nand_erase_options_t *opts) printf("\n"); if (opts->scrub) - priv_nand->scan_bbt(meminfo); + chip->scan_bbt(meminfo); return 0; }