public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] NAND read/write.jffs2 fix
Date: Fri, 16 May 2008 11:45:08 -0500	[thread overview]
Message-ID: <482DBA14.7040604@freescale.com> (raw)
In-Reply-To: <482D524F.4030009@tandberg.com>

Morten Ebbell Hestnes wrote:
>>> +       "nand read[.jffs2, .i]  addr off|partition size\n"
>>> +       "nand write[.jffs2, .i] addr off|partition size\n"
>>
>> What about .e?  Is it just for backwards compatibility that we have 
>> three commands that mean the same thing?  Do we want to document all 
>> three?
> 
> The doc/README.nand only mention .jffs2 and .i
> The option .jffs2 only has skipping bad blocks (and ECC) in common with 
> the jffs2 file system.
> If we want to be backwards compatible we should use [.jffs2|.i|.e] 
> otherwise [.i|.e] or [.skip] would be better.
> I leave this choice to you Scott.

I think we should stay compatible; I was just curious why some were 
documented and others weren't.

If we *weren't* maintaining backward compatibility, I'd make the 
block-skipping mode the default...

>>> +       "  - read/write `size' bytes starting at offset `off' to/from 
>>> memory address `addr'\n"
>>
>> Maybe mention the effect of .jffs2/.i/.e here in addition to the 
>> offline documentation.
> 
> Agree.
> Something like this ?
>     "nand - NAND sub-system\n",
>     "info - show available NAND devices\n"
>     "nand device [dev] - show or set current device\n"
>     "nand read[.jffs2|.i|.e] addr off|partition size - read `size' bytes\n"
>     " starting at offset `off' to memory address `addr'. Using one of\n"
>     " the `.' options bad blocks is skipped otherwise read as 0xff\n"
>     "nand write[.jffs2|.i|.e] addr off|partition size - write `size'\n"
>     " bytes starting at offset `off' from memory address `addr'. Using\n"
>     " one of `.' options bad blocks is skipped otherwise write fails\n"
>     "nand erase [clean] [off size] - erase `size' bytes from offset\n"
>     " `off' (entire device if not specified)\n"
>     "nand bad - show bad blocks\n"
>     "nand dump[.oob] off - dump page\n"
>     "nand scrub - really clean NAND erasing bad blocks (UNSAFE)\n"
>     "nand markbad off - mark bad block at offset (UNSAFE)\n"
>     "nand biterr off - make a bit error at offset (UNSAFE)\n"
>     "nand lock [tight] [status] - bring nand to lock state or display\n"
>     " locked pages\n"
>     "nand unlock [offset] [size] - unlock section\n");

s/blocks is skipped otherwise read/blocks are skipped, otherwise they 
are read/

Looks OK otherwise.

>>> +        block_len = nand->erasesize - (offset & (nand->erasesize - 1));
>>> +
>>> +        if (!nand_block_isbad (nand, offset))
>>> +            len_excl_bad += block_len;
>>
>> Hmm, is it safe to call nand_block_isbad with an offset that isn't the 
>> start of the block?  The BBT implementation seems OK with it, but what 
>> about block_bad callbacks?
> 
> Both nand_block_bad and nand_isbad_bbt seems ok.
> But just in case it could be changed to "if (!nand_block_isbad (nand, 
> offset & (~nand->erasesize + 1))"
> 
> I do not understand what you mean about block_bad callbacks.

An individual NAND driver can provide its own block_bad() method in the 
nand_chip struct, and the semantics of the "ofs" parameter aren't described.

There's no code currently in-tree that would have a problem with it, but 
it might be better to mask it anyway.

-Scott

      reply	other threads:[~2008-05-16 16:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-13 11:49 [U-Boot-Users] [PATCH] NAND read/write.jffs2 fix Morten Ebbell Hestens
2008-05-13 20:41 ` Scott Wood
2008-05-14 17:40   ` Kim Phillips
2008-05-15 15:26     ` Morten Ebbell Hestnes
2008-05-16  9:22   ` Morten Ebbell Hestnes
2008-05-16 16:45     ` 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=482DBA14.7040604@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