From patchwork Thu Jan 31 19:47:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Wood X-Patchwork-Id: 217248 X-Patchwork-Delegate: scottwood@freescale.com 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 40B662C008E for ; Fri, 1 Feb 2013 06:49:20 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 08AEC4A0F6; Thu, 31 Jan 2013 20:49:18 +0100 (CET) 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 W8+8zHSRBVwp; Thu, 31 Jan 2013 20:49:17 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1077A4A0F8; Thu, 31 Jan 2013 20:49:16 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7BE754A0F8 for ; Thu, 31 Jan 2013 20:49:12 +0100 (CET) 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 zLGE5zbVQ7fk for ; Thu, 31 Jan 2013 20:49:09 +0100 (CET) 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 co1outboundpool.messaging.microsoft.com (co1ehsobe005.messaging.microsoft.com [216.32.180.188]) by theia.denx.de (Postfix) with ESMTPS id B2D934A0F6 for ; Thu, 31 Jan 2013 20:49:07 +0100 (CET) Received: from mail125-co1-R.bigfish.com (10.243.78.200) by CO1EHSOBE034.bigfish.com (10.243.66.99) with Microsoft SMTP Server id 14.1.225.23; Thu, 31 Jan 2013 19:49:05 +0000 Received: from mail125-co1 (localhost [127.0.0.1]) by mail125-co1-R.bigfish.com (Postfix) with ESMTP id C7DCC540150 for ; Thu, 31 Jan 2013 19:49:04 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1ee6h1de0h1202h1e76h1d1ah1d2ahzz8275bhz2dh2a8h668h839h944hd25hf0ah1220h1288h12a5h12a9h12bdh137ah13b6h1441h14ddh1504h1537h153bh162dh1631h1758h18e1h1946h1155h) Received: from mail125-co1 (localhost.localdomain [127.0.0.1]) by mail125-co1 (MessageSwitch) id 1359661690838564_10580; Thu, 31 Jan 2013 19:48:10 +0000 (UTC) Received: from CO1EHSMHS001.bigfish.com (unknown [10.243.78.205]) by mail125-co1.bigfish.com (Postfix) with ESMTP id 5F482A80077 for ; Thu, 31 Jan 2013 19:48:04 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CO1EHSMHS001.bigfish.com (10.243.66.11) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 31 Jan 2013 19:48:04 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-004.039d.mgd.msft.net (10.84.1.14) with Microsoft SMTP Server (TLS) id 14.2.318.3; Thu, 31 Jan 2013 19:47:56 +0000 Received: from home.buserror.net ([10.214.83.246]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r0VJltLr010109 for ; Thu, 31 Jan 2013 12:47:56 -0700 Date: Thu, 31 Jan 2013 13:47:55 -0600 From: Scott Wood To: Message-ID: <20130131194755.GA6926@home.buserror.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-OriginatorOrg: freescale.com Subject: [U-Boot] [PATCH] nand/mxc: set host->page_addr for NAND_CMD_READOOB X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 Without this, all OOB reads are from the last page normally read (or zero at boot). This results in bad block scans failing to look in the right place, and so no bad blocks are found. Signed-off-by: Scott Wood --- From IRC discussion with a2cypher. Compile-tested only; testing would be appreciated. drivers/mtd/nand/mxc_nand.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index d0ded48..32ba340 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c @@ -1021,6 +1021,7 @@ void mxc_nand_command(struct mtd_info *mtd, unsigned command, break; case NAND_CMD_READOOB: + host->page_addr = page_addr; host->col_addr = column; host->spare_only = true; if (host->pagesize_2k)