JFFS2-on-DataFlash : 2 - DataFlash support

Jörn Engel joern at wohnheim.fh-wedel.de
Mon Feb 7 07:55:01 EST 2005


On Thu, 3 February 2005 11:03:16 +0200, Andrew Victor wrote:
> 
> > > +	/* and Dataflash */
> > > +	if (jffs2_dataflash(c)) {
> > > +		ret = jffs2_dataflash_setup(c);
> > > +		if (ret)
> > > +			return ret;
> > > +	}
> > 
> > This can be a bit simpler:
> > 	ret = jffs2_dataflash_setup()
> > 	if (ret)
> > 		return ret;
> 
> I just copied the way it was done for the the NOR ECC flash.

That's a good explantion, but not a good excuse. ;)

> > > -	return BLK_STATE_ALLFF;	/* OK to erase if all blocks are like this */
> > > +	if (c->cleanmarker_size == 0)
> > > +		return BLK_STATE_CLEANMARKER;	/* don't bother with re-erase */
> 
> If a cleanmarker is not detected (within the first EMPTY_SCAN_SIZE bytes
> of a block), the block is added to the 'erase_pending_list' to be
> re-erased (and have a new cleanmarker written).
> 
> Since we don't need cleanmarkers on DataFlash, we return
> BLK_STATE_CLEANMARKER from jffs2_scan_eraseblock() so that the block
> rather gets added directly to the 'free_list'.

Why don't you need cleanmarkers?

With all other flash types, cleanmarkers catch the case where your
power fails during flash erase.  If that happens, you cannot trust the
eraseblock.  It could be fully erased, it could also just _look_ as if
it was and fail later on.  Bad.

Now you claim that this is not the case for DataFlash.  So I'd like
some explanation before I trust your code.

Jörn

-- 
I've never met a human being who would want to read 17,000 pages of
documentation, and if there was, I'd kill him to get him out of the
gene pool.
-- Joseph Costello




More information about the linux-mtd mailing list