[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JFFS2 on NAND flash



On Friday,  1. February 2002 11:16, David Woodhouse wrote:
>
> But it doesn't matter. We want to batch writes and only do one write per
> page, with page-based ECC. See my ramblings of last week on how we can do
> this. There's also a half-arsed attempt at implementing it in CVS, on the
> jffs2-nand-branch. Don't bother looking at it unless you're prepared to
> hack on it though. It doesn't have a whelk's chance in a supernova of
> actually working - I just thought it might help to illustrate what I meant.
Where can I find this jss2-nand-branch ? I just wan't to have a look on it. I 
don't know if I have the time and the will do dive into the wilderness of 
this stuff.

I tried something different. I traced on the current jffs2 the consecutive I  
writes to the pages. I found nowhere a situation where a consecutive write to 
a page was intermitted by a write to a different page. So I assumed that I 
can collect the write data (up to 512 Byte) in the nand driver and write it 
out (with ECC) when a access to a different page occurs. Then I mark this 
page as written. Occures a read access to this page before data are written, 
I give back the collected data instead of the empty page contents. In the 
case of a erase request (that should never happen), which concerns the 
collected page I cancel the collected data. If there comes a write request to 
a already written page, what happened not yet., I copy the block content to 
one of some spare blocks I reserved at  the end of  the device. Then I erase 
the page, and write the copied data back. The requested page is collected 
again until a write request to a different page. In case of powerdown between 
erase and writeback I check the spareblocks after reboot. If there is a valid 
spareblock with a corresponding empty block on the device I move the data to 
this area and my filesystem is ok. I thought about to use one of my 
spareblocks to flash out the consecutive write data to different pages and 
save also for this case the consistancy of the filesystem and check for this 
on reboot too. I have not implemented this yet. The other stuff was hack 
enough. And it works until now. I will run a testprogram for the hole night.

I tried this on jffs1 too, but the same happens as on my first test without 
that hack. I don't know why. The only thing I saw, was that it happens, when 
the wraparound in the device occures from 1st to last page. Maybe that's a 
hint.

Thomas
__________________________________________________
Thomas Gleixner, autronix automation GmbH
auf dem berg 3, d-88690 uhldingen-muehlhofen
fon: +49 7556 919891 , fax: +49 7556 919886
mail: gleixner@xxxxxxx.de">http://www.autronix.de  

To unsubscribe from this list: send the line "unsubscribe jffs-dev" in
the body of a message to majordomo@xxxxxxx.com