From: Artem Bityutskiy <dedekind1@gmail.com>
To: Vimal Singh <vimal.newwork@gmail.com>
Cc: Steve Sakoman <sakoman@gmail.com>,
Tony Lindgren <tony@atomide.com>,
linux-omap@vger.kernel.org,
Linux MTD <linux-mtd@lists.infradead.org>,
linux-arm-kernel@lists.infradead.org
Subject: Re: Issue in oamp nand driver with 32-bit reads in prefetch mode
Date: Sun, 10 Jan 2010 10:46:35 +0200 [thread overview]
Message-ID: <1263113195.7315.129.camel@localhost.localdomain> (raw)
In-Reply-To: <ce9ab5790912310420h20beb04csba060b3f5cfeee92@mail.gmail.com>
On Thu, 2009-12-31 at 17:50 +0530, Vimal Singh wrote:
> 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.
>
> Here is a patch to fix this issue:
>
> 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);
Pushed this patch to my l2-mtd-2.6.git/dunno.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2010-01-10 8:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-23 9:33 Issue in oamp nand driver with 32-bit reads in prefetch mode Vimal Singh
2009-12-23 17:44 ` Tony Lindgren
2009-12-29 20:38 ` Steve Sakoman
2009-12-29 21:47 ` Steve Sakoman
2009-12-31 12:20 ` Vimal Singh
2010-01-02 15:02 ` Steve Sakoman
2010-01-10 8:46 ` Artem Bityutskiy [this message]
2010-01-11 6:30 ` Vimal Singh
2010-01-16 21:35 ` Artem Bityutskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1263113195.7315.129.camel@localhost.localdomain \
--to=dedekind1@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=sakoman@gmail.com \
--cc=tony@atomide.com \
--cc=vimal.newwork@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox