From patchwork Wed Dec 23 09:33:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vimal singh X-Patchwork-Id: 69483 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 nBN9Y85p029380 for ; Wed, 23 Dec 2009 09:34:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754172AbZLWJeI (ORCPT ); Wed, 23 Dec 2009 04:34:08 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754159AbZLWJeH (ORCPT ); Wed, 23 Dec 2009 04:34:07 -0500 Received: from mail-bw0-f227.google.com ([209.85.218.227]:51406 "EHLO mail-bw0-f227.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752771AbZLWJeF (ORCPT ); Wed, 23 Dec 2009 04:34:05 -0500 Received: by bwz27 with SMTP id 27so4616881bwz.21 for ; Wed, 23 Dec 2009 01:34:01 -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:content-type; bh=RpfJHWXo6S1EH2Z3SpFxZX5KOl1uXZGqFZTgCD0LwNY=; b=sjt6BhQ8LQeP4LoEeaG+daPcTr0tNv+i2mOEbAWhGabjVNqlTDEz8+xLhd9jkAzCH8 ksbdfNqKJfnsGQWvlG1Z+LFmJP40ZRTi0BPQoh+sRJx5ifR3DeoQvOtB6QmfaKxcXfoX 7Z5K1HNmvMUN5uXpYOPyQuk7X6DPQB7q3U4Gk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=B6ZshqAc5TDaIuiYaZoX7Ul/LdUjZnnw6u1fI0LOE9GJQmMPSSeuJZkVTDebIn2fzR htu1FklYYuQJqqvTA/i06ZkmlughlQ+Gv3MOXvCqfK/m6qBWztdAwq+Xe5N3HOVpvybx Dv/ArI2+IzaVZur5StNA5evDOzWJIPj4ZNFYE= MIME-Version: 1.0 Received: by 10.204.5.66 with SMTP id 2mr1705748bku.198.1261560841216; Wed, 23 Dec 2009 01:34:01 -0800 (PST) From: Vimal Singh Date: Wed, 23 Dec 2009 15:03:41 +0530 Message-ID: Subject: Issue in oamp nand driver with 32-bit reads in prefetch mode To: linux-omap@vger.kernel.org, Linux MTD , linux-arm-kernel@lists.infradead.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 aaef170..dc493f5 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c @@ -288,14 +288,14 @@ static void omap_read_buf_pref(struct mtd_info struct omap_nand_info, mtd); uint32_t pfpw_status = 0, r_count = 0; int ret = 0; - u32 *p = (u32 *)buf; + u16 *p = (u16 *)buf; /* take care of subpage reads */ - for (; len % 4 != 0; ) { + for (; len % 2 != 0; ) { *buf++ = __raw_readb(info->nand.IO_ADDR_R); len--; } - p = (u32 *) buf; + p = (u16 *) buf; /* configure and start prefetch transfer */ ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x0); @@ -308,10 +308,10 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len) } else { do { pfpw_status = gpmc_prefetch_status(); - r_count = ((pfpw_status >> 24) & 0x7F) >> 2; - ioread32_rep(info->nand_pref_fifo_add, p, r_count); + r_count = ((pfpw_status >> 24) & 0x7F) >> 1; + ioread16_rep(info->nand_pref_fifo_add, p, r_count); p += r_count; - len -= r_count << 2; + len -= r_count << 1; } while (len);