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: 71294 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o06E6vSN004101 for ; Wed, 6 Jan 2010 14:06:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755824Ab0AFOG5 (ORCPT ); Wed, 6 Jan 2010 09:06:57 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755859Ab0AFOG4 (ORCPT ); Wed, 6 Jan 2010 09:06:56 -0500 Received: from mail-bw0-f227.google.com ([209.85.218.227]:57168 "EHLO mail-bw0-f227.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755758Ab0AFOGz (ORCPT ); Wed, 6 Jan 2010 09:06:55 -0500 Received: by bwz27 with SMTP id 27so10688181bwz.21 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 Cc: linux-omap@vger.kernel.org Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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 */