From patchwork Thu Dec 31 12:20:44 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vimal singh X-Patchwork-Id: 70367 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 nBVCLA0V022035 for ; Thu, 31 Dec 2009 12:21:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751100AbZLaMVJ (ORCPT ); Thu, 31 Dec 2009 07:21:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750885AbZLaMVI (ORCPT ); Thu, 31 Dec 2009 07:21:08 -0500 Received: from mail-bw0-f227.google.com ([209.85.218.227]:60299 "EHLO mail-bw0-f227.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750731AbZLaMVH convert rfc822-to-8bit (ORCPT ); Thu, 31 Dec 2009 07:21:07 -0500 Received: by bwz27 with SMTP id 27so7914357bwz.21 for ; Thu, 31 Dec 2009 04:21:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=sbOV9G0pTkSikSHoyv114G1EWGLWh46+0zR+u29QqUI=; b=WhDxr9qPVlas39ui3Ng5Ljq99E1fp6e+xH8UFQPIC/66Z3Dm8WbWjFlOlKBHbGTSmg yAt1m602l1IYhRcrCcHEOxLA75dU7p1Z9IaCMuIRgdEO7C1UbhcHkOCVby5NUhh7i4WL bRkCOP6kN7rNhBM7XKR+pi9SIDcl3qH/FZrak= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=ad2OssZXSUsZ3CVZWPUtgUegTk8z+wAk0yca11qwXlGJXPMnJPP2nXJuKdq4sEOh58 haErDhlNqgFz5cApDM+HxaMCsg8ppO6BDUIaFtODnJGfJdwArXb/WP78qVw8FSj3WzDg HX+nyqsH9pucxyhwgaV8EFHcHsDsY+0XegULI= MIME-Version: 1.0 Received: by 10.204.154.208 with SMTP id p16mr6911639bkw.80.1262262064148; Thu, 31 Dec 2009 04:21:04 -0800 (PST) In-Reply-To: <5e088bd90912291347j370ab30cid7c6cfc558c2ed18@mail.gmail.com> References: <20091223174429.GD3512@atomide.com> <5e088bd90912291238t1f2aba64na94887b2f864454d@mail.gmail.com> <5e088bd90912291347j370ab30cid7c6cfc558c2ed18@mail.gmail.com> From: Vimal Singh Date: Thu, 31 Dec 2009 17:50:44 +0530 Message-ID: Subject: Re: Issue in oamp nand driver with 32-bit reads in prefetch mode To: Steve Sakoman Cc: Tony Lindgren , 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 1bb799f..75004fe 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c @@ -295,11 +295,14 @@ static void omap_read_buf_pref(struct 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 */ ret = gpmc_prefetch_enable(info->gpmc_cs, 0x0, len, 0x0);