From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] The command "nand write.yaffs" is not working correctly
Date: Mon, 3 Oct 2011 15:43:59 -0500 [thread overview]
Message-ID: <4E8A1E8F.9060608@freescale.com> (raw)
In-Reply-To: <BE72CBA69B1D6F44B0680DF984332A32291DCC@039-SN1MPN1-005.039d.mgd.msft.net>
On 09/30/2011 04:10 AM, Jin Zhengxiong-R64188 wrote:
> I once met the similar issue with 2011.03 base and fixed it with following patch, But
> I didn't do a detail checking for that, FYI...
>
> @@ -499,6 +499,7 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
> return -EINVAL;
> }
>
> +#ifndef CONFIG_CMD_NAND_YAFFS
> if (!need_skip) {
> rval = nand_write (nand, offset, length, buffer);
> if (rval == 0)
> @@ -509,13 +510,12 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
> offset, rval);
> return rval;
> }
> -
> +#endif
This should be a runtime check for whether yaffs was actually requested.
The current code does something similar for WITH_DROP_FFS.
Or perhaps we should just drop this optimization altogether, barring
someone demonstrating that it makes a huge performance difference.
> while (left_to_write > 0) {
> size_t block_offset = offset & (nand->erasesize - 1);
> size_t write_size;
>
> WATCHDOG_RESET ();
> -
> if (nand_block_isbad (nand, offset & ~(nand->erasesize - 1))) {
> printf ("Skip bad block 0x%08llx\n",
> offset & ~(nand->erasesize - 1));
> @@ -546,7 +546,7 @@ int nand_write_skip_bad(nand_info_t *nand, loff_t offset, size_t *length,
> ops.oobbuf = ops.datbuf + pagesize;
>
> rval = nand->write_oob(nand, offset, &ops);
> - if (!rval)
> + if ( rval != 0)
> break;
>
> offset += pagesize;
Drop these.
-Scott
prev parent reply other threads:[~2011-10-03 20:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-21 1:09 [U-Boot] The command "nand write.yaffs" is not working correctly Peter Pan
2011-09-30 9:10 ` Jin Zhengxiong-R64188
2011-09-30 15:35 ` Peter Pan
2011-10-03 20:43 ` Scott Wood [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=4E8A1E8F.9060608@freescale.com \
--to=scottwood@freescale.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