From: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] nand/mxc: set host->page_addr for NAND_CMD_READOOB
Date: Fri, 1 Feb 2013 00:01:32 +0100 (CET) [thread overview]
Message-ID: <1207718459.235928.1359673292639.JavaMail.root@advansee.com> (raw)
In-Reply-To: <1359671771.31540.27@snotra>
On Thursday, January 31, 2013 11:36:11 PM, Scott Wood wrote:
> On 01/31/2013 02:45:02 PM, Beno?t Th?baudeau wrote:
> > Hi Scott,
> >
> > On Thursday, January 31, 2013 8:47:55 PM, Scott Wood wrote:
> > > Without this, all OOB reads are from the last page normally read
> > > (or zero at boot). This results in bad block scans failing to look
> > > in the right place, and so no bad blocks are found.
>
> Looking more closely, the calls to send_addr() use page_addr rather
> than host->page_addr, and the oob page read uses "page" in the call to
> cmdfunc, so maybe it's just the debug output that was wrong?
Looks like.
> > > Signed-off-by: Scott Wood <scottwood@freescale.com>
> > > ---
> > > From IRC discussion with a2cypher. Compile-tested only; testing
> > > would be appreciated.
> > >
> > > drivers/mtd/nand/mxc_nand.c | 1 +
> > > 1 file changed, 1 insertion(+)
> > >
> > > diff --git a/drivers/mtd/nand/mxc_nand.c
> > b/drivers/mtd/nand/mxc_nand.c
> > > index d0ded48..32ba340 100644
> > > --- a/drivers/mtd/nand/mxc_nand.c
> > > +++ b/drivers/mtd/nand/mxc_nand.c
> > > @@ -1021,6 +1021,7 @@ void mxc_nand_command(struct mtd_info *mtd,
> > unsigned
> > > command,
> > > break;
> > >
> > > case NAND_CMD_READOOB:
> > > + host->page_addr = page_addr;
> > > host->col_addr = column;
> > > host->spare_only = true;
> > > if (host->pagesize_2k)
> >
> > For which NFC version and NAND Flash page size is this?
>
> All, presumably.
My i.MX platforms with NFC v2.1 and v3 can detect bad blocks (both true ones,
and the fake ones created at the end of the NAND for the BBT), so there is
something else going on if a2cypher had an issue.
> > Do you have a means of duplicating the issue?
>
> Not personally; it was found during an IRC discussion with a2cypher.
OK.
> > I wonder if the appropriate fix would not rather be to replace all
> > occurrences
> > of "host->page_addr" with "page", except in mxc_nand_correct_data()
> > and
> > mxc_nand_command(). Otherwise, it looks like there will still be
> > weird things
> > going on with this variable.
>
> Hmm, what's going on in mxc_nand_read_page_raw_syndrome()? The caller
> of that calls cmdfunc, then the mxc_nand_read_page_raw_syndrome() calls
> it again, using host->page_addr that was set the first time cmdfunc was
> called? :-P
Indeed. Whatever the caller does, it's supposed to pass the right page to
mxc_nand_read_page_raw_syndrome(), so let's use the passed "page" everywhere,
and use "host->page_addr" only to keep track of accessed pages for
mxc_nand_correct_data(), so that there is no dependency between calls?
Best regards,
Beno?t
prev parent reply other threads:[~2013-01-31 23:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-31 19:47 [U-Boot] [PATCH] nand/mxc: set host->page_addr for NAND_CMD_READOOB Scott Wood
2013-01-31 20:45 ` Benoît Thébaudeau
2013-01-31 22:36 ` Scott Wood
2013-01-31 23:01 ` Benoît Thébaudeau [this message]
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=1207718459.235928.1359673292639.JavaMail.root@advansee.com \
--to=benoit.thebaudeau@advansee.com \
--cc=u-boot@lists.denx.de \
/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