[RFC] refactoring MTD cmdset ops, jedec_probe, and cfi_probe

Thayne Harbaugh tharbaugh at lnxi.com
Tue Jul 13 11:21:48 EDT 2004


On Tue, 2004-07-13 at 09:04 -0600, Eric W. Biederman wrote:
> Thayne Harbaugh <tharbaugh at lnxi.com> writes:

> > There's a short list of things that have been removed or changed
> > significantly (although this is from memory and may not match the
> > current code):
> > 
> > * read-back check of written data
> 
> I have a patch  for that already.  Since we are not checking any other
> status bits.  At least verifying the data is correct is useful.  

Wonderful.

> > * retry of failed writes
> 
> This one is more interesting.   I don't know if it should be generic or we should
> just override do_write_one_word...
> 
> One way or another we will get this one back in there.

Good.
 
> > * unlock address for some chips (although this is likely part of the big
> > rewrite)
> > 
> > In the end, it's much appreciated that everything was cleaned up - there
> > were some major things done that I wanted to do but was too timid to do
> > major overhauling of the code.  Unfortunately it was just continuing to
> > grow harrier and uglier.
> 
> Thayne this problem I am not familiar with.  Could I have some details?

Errrr . . . the problem of the unlock address or of the harry, ugly
code?

The unlock story is that there was *no* unlock code in cfi_cmdset_0002.
One of the newer SST chips requires unlocking of the blocks.  Unlike
other chips that need unlocking, the addresses for unlocking this
particular chip is not at the block address but below the address of the
entire chip.

It was strange, but I figured that since there wasn't already an unlock
function it wouldn't matter that the new one was chip specific and less
than ideal.  Of course no more than a few weeks after I put it in the
unlock function was needed for *sane* flash chips and so the unlock code
was *corrected*.

The problem with the harry and ugly code was that the status checking
code was reproduced in multiple spots (at least three).  It was bulky
and very sensitive.  All of it needed to be consolidated into a single
location.  That was part of the last, major rewrite that *fixed* some of
the things that should have been left in.






More information about the linux-mtd mailing list