From patchwork Wed Jan 6 14:06:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vimal singh X-Patchwork-Id: 42295 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 E5544B6EEF for ; Thu, 7 Jan 2010 01:08:48 +1100 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NSWXP-0000HE-BN; Wed, 06 Jan 2010 14:07:03 +0000 Received: from mail-bw0-f212.google.com ([209.85.218.212]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NSWXH-0000EQ-8t for linux-mtd@lists.infradead.org; Wed, 06 Jan 2010 14:07:00 +0000 Received: by bwz4 with SMTP id 4so10833020bwz.2 for ; Wed, 06 Jan 2010 06:06:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:cc:content-type; bh=ulG7bzuiMg8EYpNxjPeKQFcOZmBN/uWuWexf14d036k=; b=gY36WkGLUQPDyNxdFYvUmmeqvYNIihoEMjU6bsml2l7lfUVYK2hQz4sI1FnUfNVfmB H+iVkpxB9aQfD+JYqlOBIhEvzB6xgf5gVS/EWoYloOT0QM+5N4htXtN8zNmVjIany9JV eQI+2552DyUe8T6cdV5sskypj3ZRCONn7TdvI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:cc:content-type; b=OqiU5fTBhbAqUS5Ce+uQDd4C6Tw1dBPedLW2BrXQYatQdzoqQVH85NTUJVIku49Z8A N4yhfb11VUxagWJEVu5cM2NWe36KoGObZ3Wx0kd30xj69R80NU9KXZZ0RGCeqLHSoz+a IpVSQyVnBewArZ/CiVwdv0IQ1DwGpGV9uLY8o= MIME-Version: 1.0 Received: by 10.204.27.8 with SMTP id g8mr1339122bkc.183.1262786814168; Wed, 06 Jan 2010 06:06:54 -0800 (PST) From: Vimal Singh Date: Wed, 6 Jan 2010 19:36:34 +0530 Message-ID: Subject: [PATCH 3/3][NAND][OMAP]: Fixing issue in oamp nand driver in prefetch mode read To: Linux MTD X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20100106_090655_529232_DE70F922 X-CRM114-Status: GOOD ( 15.89 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.2.5 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- _SUMMARY_ Cc: 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 From 3700088e8da8c890d9e4c6eb626e18287d149b97 Mon Sep 17 00:00:00 2001 From: Vimal Singh Date: Tue, 5 Jan 2010 16:37:03 +0530 Subject: [PATCH] NAND: OMAP: Fixing issue in oamp nand driver in prefetch mode read There is a bug in nand prefetch read routine, which comes into effect only if nand device is a 16-bit device (as we have in zoom boards). This bug is effective only with below combination of conditions: 1. nand deivce, in use, is a 16 bit device 2. nand driver supports 'subpage' read 3. SW ECC is in use This was not seen old kernel (ex: .23), because when, in early days, we tested this (nand prefetch read in LDP boards) there was no 'subpage read' support. Later when we had subpage read in (.27) kernel, we had hw ecc enabled always in our internal tree. So, we missed this bug. This patch fixes the issue. Signed-off-by: Vimal Singh --- drivers/mtd/nand/omap2.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x0); diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index 16120e2..7df303a 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c @@ -295,11 +295,14 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len) u32 *p = (u32 *)buf; /* take care of subpage reads */ - for (; len % 4 != 0; ) { - *buf++ = __raw_readb(info->nand.IO_ADDR_R); - len--; + if (len % 4) { + if (info->nand.options & NAND_BUSWIDTH_16) + omap_read_buf16(mtd, buf, len % 4); + else + omap_read_buf8(mtd, buf, len % 4); + p = (u32 *) (buf + len % 4); + len -= len % 4; } - p = (u32 *) buf; /* configure and start prefetch transfer */